<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" lang="en-US" prefix="og: http://ogp.me/ns#">
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" lang="en-US" prefix="og: http://ogp.me/ns#">
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html lang="en-US" prefix="og: http://ogp.me/ns#" >

<!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta name="keywords" content="Data Structures, Algorithms, Python, Java, C, C++, JavaScript, Android Development, SQL, Data Science, Machine Learning, PHP, Web Development, System Design, Tutorial, Technical Blogs, Interview Experience, Interview Preparation, Programming, Competitive Programming, Jobs, Coding Contests, GATE CSE, HTML, CSS, React, NodeJS, Placement, Aptitude, Quiz, Computer Science, Programming Examples, GeeksforGeeks Courses, Puzzles, SSC, Banking, UPSC, Commerce, Finance, CBSE, School, k12, General Knowledge, News, Mathematics, Exams">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0"> 
<link rel="shortcut icon" href="https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_favicon.png" type="image/x-icon" />

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta name="theme-color" content="#308D46" />
<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1' />

<meta name="image" property="og:image" content="https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200x200-min.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="200">
<meta property="og:image:height" content="200">
<meta name="facebook-domain-verification" content="xo7t4ve2wn3ywfkjdvwbrk01pvdond" />

<script src="https://cdnads.geeksforgeeks.org/synchronously_gfg_ads.min.js"></script>
<script defer src="https://apis.google.com/js/platform.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script>
<!-- Removed the below script from here to prevent loading google translate js at initial load
<script async src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> -->

<!-- FIXME:-  To be finalised whether we need to put this gpt script in header or footer  -->
<!-- //gpt.js script -->
<!-- <script async src='https://www.googletagservices.com/tag/js/gpt.js'></script> -->
<script>
   var IHPWT={}; //Initialize Namespace
  var pbjs = pbjs || {};
  pbjs.que = pbjs.que || [];
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];
  var gptRan = false;
</script>
<script defer src="https://ads.pubmatic.com/AdServer/js/pwt/162080/12331/pwt.js"></script>
      <script defer src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
  <script defer src="https://cdnads.geeksforgeeks.org/prebid.js?ver=0.1"></script>
<script defer src="https://cdnads.geeksforgeeks.org/gfg_ads.min.js?ver=0.1"></script>

<title>Different ways to create Pandas Dataframe - GeeksforGeeks</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="" />
<!--[if lt IE 9]>
<script src="https://www.geeksforgeeks.org/wp-content/themes/iconic-one/js/html5.js" type="text/javascript"></script>
<![endif]-->

<script type="application/ld+json">
    {
        "@context" : "https://schema.org",
        "@type" : "Organization",
        "name" : "GeeksforGeeks",
        "url" : "https://www.geeksforgeeks.org/",
        "logo" : "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200817185016/gfg_complete_logo_2x-min.png",
        "description" : "A computer science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.",
        "founder": [
            {
                "@type" : "Person",
                "name" : "Sandeep Jain",
                "url" : "https://in.linkedin.com/in/sandeep-jain-b3940815"
            }
        ],
        "sameAs" : [ "https://www.facebook.com/geeksforgeeks.org/",
            "https://twitter.com/geeksforgeeks",
            "https://www.linkedin.com/company/1299009",
            "https://www.youtube.com/geeksforgeeksvideos/"
        ]
    }
</script>


<!-- Question schema for single question posts only  -->

<!-- Video Schema for posts only -->
                    <script> 
                        var video_api_response = JSON.parse("{\"id\":7244,\"title\":\"Different Ways to Create a Pandas DataFrame\",\"slug\":\"different-ways-to-create-a-pandas-dataframe\",\"description\":\"<p style=\\\"margin-left:0px;\\\"><strong>Pandas DataFrame <\/strong>is a 2-dimensional labeled data structure like any table with rows and columns. The size and values of the dataframe are mutable,i.e., can be modified. It is the most commonly used pandas object.&nbsp;Pandas DataFrame can be created in multiple ways. Let\u2019s discuss different ways to create a DataFrame one by one.<\/p><p style=\\\"margin-left:0px;text-align:justify;\\\">DataFrame() function is used to create a dataframe in Pandas. The syntax of creating dataframe is:<\/p><p>pandas.DataFrame(data, index, columns)<\/p><p style=\\\"margin-left:0px;text-align:justify;\\\">where,<\/p><p style=\\\"margin-left:0px;text-align:justify;\\\"><strong>data<\/strong>: It is a dataset from which dataframe is to be created. It can be list, dictionary, scalar value, series, ndarrays, etc.<\/p><p style=\\\"margin-left:0px;text-align:justify;\\\"><strong>index<\/strong>: It is optional, by default the index of the dataframe starts from 0 and ends at the last data value(n-1). It defines the row label explicitly.<\/p><p style=\\\"margin-left:0px;text-align:justify;\\\"><strong>columns<\/strong>: This parameter is used to provide column names in the dataframe. If the column name is not defined by default, it will take a value from 0 to n-1.<\/p><p><br>Related Article : &nbsp;<a href=\\\"https:\/\/www.geeksforgeeks.org\/different-ways-to-create-pandas-dataframe\/\\\">https:\/\/www.geeksforgeeks.org\/different-ways-to-create-pandas-dataframe\/<\/a><\/p>\",\"source\":\"https:\/\/videos.geeksforgeeks.org\/hls\/306a06c48b0823b4624339a8cf599074gfg-DifferentWaystoCreateaPandasDataFrameGeeksforGeeks20221025145224.m3u8\",\"category\":[{\"term_id__id\":262,\"term_id__term_name\":\"Pandas dataframe\",\"term_id__term_type\":2,\"term_id__slug\":\"pandas-dataframe\"},{\"term_id__id\":10,\"term_id__term_name\":\"Python\",\"term_id__term_type\":1,\"term_id__slug\":\"python\"}],\"video_type\":\"geeksforgeeks\",\"meta\":{\"thumbnail\":\"https:\/\/videocdn.geeksforgeeks.org\/geeksforgeeks\/DifferentWaystoCreateaPandasDataFrame\/DifferentWaystoCreateaPandasDataFrame20221025145232-small.png\",\"largeThumbnail\":\"https:\/\/videocdn.geeksforgeeks.org\/geeksforgeeks\/DifferentWaystoCreateaPandasDataFrame\/DifferentWaystoCreateaPandasDataFrame20221025145232.jpg\",\"likes\":0,\"views\":8200,\"isFeatured\":0,\"isPremium\":0,\"isPublic\":0,\"format\":\"video\/mp4\",\"revision\":{}},\"time\":\"25\/10\/2022\",\"seo\":{\"description\":\"<p style=\\\"margin-left:0px;\\\"><strong>Pandas DataFrame <\/strong>is a 2-dimens\",\"thumbnail\":\"https:\/\/videocdn.geeksforgeeks.org\/geeksforgeeks\/DifferentWaystoCreateaPandasDataFrame\/DifferentWaystoCreateaPandasDataFrame20221025145232-seo.png\"},\"subtitle\":\"https:\/\/videos.geeksforgeeks.org\/subtitles\/DifferentWaystoCreateaPandasDataFrameGeeksforGeeks20221025145224.vtt\",\"duration\":774,\"post_list\":[],\"course_link\":null,\"views\":\"8200\",\"video_schema\":{\"@context\":\"https:\/\/schema.org\",\"@type\":\"VideoObject\",\"name\":\"Different Ways to Create a Pandas DataFrame\",\"description\":\"Pandas DataFrame is a 2-dimensional labeled data structure like any table with rows and columns. The size and values of the dataframe are mutable,i.e., can be modified. It is the most commonly used pandas object. nbspPandas DataFrame can be created in multiple ways. Lets discuss different ways to create a DataFrame one by one.DataFrame() function is used to create a dataframe in Pandas. The syntax of creating dataframe ispandas.DataFrame(data, index, columns)where,data It is a dataset from which dataframe is to be created. It can be list, dictionary, scalar value, series, ndarrays, etc.index It is optional, by default the index of the dataframe starts from 0 and ends at the last data value(n-1). It defines the row label explicitly.columns This parameter is used to provide column names in the dataframe. If the column name is not defined by default, it will take a value from 0 to n-1.Related Article   nbsphttpswww.geeksforgeeks.orgdifferent-ways-to-create-pandas-dataframe\",\"thumbnailUrl\":[\"https:\/\/videocdn.geeksforgeeks.org\/geeksforgeeks\/DifferentWaystoCreateaPandasDataFrame\/DifferentWaystoCreateaPandasDataFrame20221025145232-seo.png\",\"https:\/\/videocdn.geeksforgeeks.org\/geeksforgeeks\/DifferentWaystoCreateaPandasDataFrame\/DifferentWaystoCreateaPandasDataFrame20221025145232-small.png\",\"https:\/\/videocdn.geeksforgeeks.org\/geeksforgeeks\/DifferentWaystoCreateaPandasDataFrame\/DifferentWaystoCreateaPandasDataFrame20221025145232.jpg\"],\"uploadDate\":\"2022-10-25T14:54:39Z\",\"duration\":\"PT0H12M54S\",\"contentUrl\":\"https:\/\/www.geeksforgeeks.org\/videos\/different-ways-to-create-a-pandas-dataframe\/\"}}");
                    </script>
                            <script type="application/ld+json">{"@context":"https://schema.org","@type":"VideoObject","name":"Different Ways to Create a Pandas DataFrame","description":"Pandas DataFrame is a 2-dimensional labeled data structure like any table with rows and columns. The size and values of the dataframe are mutable,i.e., can be modified. It is the most commonly used pandas object. nbspPandas DataFrame can be created in multiple ways. Lets discuss different ways to create a DataFrame one by one.DataFrame() function is used to create a dataframe in Pandas. The syntax of creating dataframe ispandas.DataFrame(data, index, columns)where,data It is a dataset from which dataframe is to be created. It can be list, dictionary, scalar value, series, ndarrays, etc.index It is optional, by default the index of the dataframe starts from 0 and ends at the last data value(n-1). It defines the row label explicitly.columns This parameter is used to provide column names in the dataframe. If the column name is not defined by default, it will take a value from 0 to n-1.Related Article   nbsphttpswww.geeksforgeeks.orgdifferent-ways-to-create-pandas-dataframe","thumbnailUrl":["https://videocdn.geeksforgeeks.org/geeksforgeeks/DifferentWaystoCreateaPandasDataFrame/DifferentWaystoCreateaPandasDataFrame20221025145232-seo.png","https://videocdn.geeksforgeeks.org/geeksforgeeks/DifferentWaystoCreateaPandasDataFrame/DifferentWaystoCreateaPandasDataFrame20221025145232-small.png","https://videocdn.geeksforgeeks.org/geeksforgeeks/DifferentWaystoCreateaPandasDataFrame/DifferentWaystoCreateaPandasDataFrame20221025145232.jpg"],"uploadDate":"2022-10-25T14:54:39Z","duration":"PT0H12M54S","contentUrl":"https://www.geeksforgeeks.org/videos/different-ways-to-create-a-pandas-dataframe/"}</script>
      
<!-- adding article schema markup -->
    <script type='application/ld+json'>
    {
        "@context": "https://schema.org",
        "@type": "Article",
        "mainEntityOfPage": {
        "@type": "WebPage",
        "id": "https://www.geeksforgeeks.org/different-ways-to-create-pandas-dataframe/"
        },
        "headline": "Different ways to create Pandas Dataframe",
        "datePublished": "2018-11-14 12:25:10",
        "dateModified": "2024-07-05 04:05:52",
        "image": {
            "@type": "ImageObject",
            "url": "https://media.geeksforgeeks.org/wp-content/uploads/gfg_200X200-100x100.png",
            "width": "100",
            "height": "100"
        },
        "author": {
        "@type": "Organization",
        "name": "GeeksforGeeks",
        "url": "https://www.geeksforgeeks.org/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg",
            "width": "301",
            "height": "40"
        }
        },
        "publisher": {
        "@type": "Organization",
        "name": "GeeksforGeeks",
        "url": "https://www.geeksforgeeks.org/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg",
            "width": "301",
            "height": "40"
        }
        },
        "description": "It is the most commonly used Pandas object. The pd. DataFrame() function is used to create a DataFrame in Pandas . You can also create Pandas DataFrame in multiple ways. There are several ways to create a Pandas Dataframe in Python . You can create a DataFrame with the following methods",
        "about": [
            { "@type": "Thing", "name": "AIMLDS" },{ "@type": "Thing", "name": "Python" },{ "@type": "Thing", "name": "ProgrammingLanguage" },{ "@type": "Thing", "name": "Picked" },{ "@type": "Thing", "name": "PythonpandasdataFrame" },{ "@type": "Thing", "name": "Pythonpandas" }        ]
    }
    </script>

<!-- Adding FAQ schema -->
<script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "FAQPage",
                "mainEntity": [{
                "@type": "Question",
                "name": " What are the methods for DataFrame in Python? ",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": " Some common methods for pandas DataFrame include: 
 head()  :  Returns the first n rows.  tail()  :  Returns the last n rows.  info()  :  Provides a summary of the DataFrame.  describe()  :  Generates descriptive statistics.  sort_values()  :  Sorts the DataFrame by specified columns.  groupby()  :  Groups the DataFrame using a mapper or by series of columns.  merge()  :  Merges DataFrame or named series objects with a database-style join.  apply()  :  Applies a function along the axis of the DataFrame.  drop()  :  Removes specified labels from rows or columns.  pivot_table()  :  Creates a pivot table.  fillna()  :  Fills NA/NaN values.  isnull()  :  Detects missing values. "
                }
            },{
                "@type": "Question",
                "name": " Which data types can be used to create DataFrame? ",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": " DataFrames can be created using various data types including: 
 Dictionaries of arrays, lists, or series.  Lists of dictionaries.  2D NumPy arrays.  Series.  Another DataFrame import pandas as pdimport numpy as np# From a dictionary of listsdf1 = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})# From a list of dictionariesdf2 = pd.DataFrame([{'A': 1, 'B': 4}, {'A': 2, 'B': 5}, {'A': 3, 'B': 6}])# From a 2D NumPy arraydf3 = pd.DataFrame(np.array([[1, 4], [2, 5], [3, 6]]), columns=['A', 'B'])# From a seriesdf4 = pd.DataFrame({'A': pd.Series([1, 2, 3]), 'B': pd.Series([4, 5, 6])})"
                }
            },{
                "@type": "Question",
                "name": " How many data types are there in a pandas DataFrame? ",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": " A pandas DataFrame can contain multiple data types across its columns, such as: 
 int64  :  Integer values.  float64  :  Floating-point values.  object  :  Text or mixed types.  datetime64[ns]  :  Date and time values.  bool  :  Boolean values.  You can check the data types of a DataFrame using the  dtypes  attribute. 
df = pd.DataFrame({'A': [1, 2, 3], 'B': [4.0, 5.1, 6.2], 'C': ['x', 'y', 'z']})print(df.dtypes)# Output:# A      int64# B    float64# C     object# dtype: object"
                }
            },{
                "@type": "Question",
                "name": " Why use DataFrame instead of a dataset? ",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": " DataFrames are specifically designed for data manipulation and analysis, offering several advantages over general datasets: 
 Integrated handling of missing data.  Label-based indexing for rows and columns.  Powerful data alignment and broadcasting.  Extensive functionality for data manipulation, aggregation, and transformation.  Better performance for operations involving structured data.  Integration with a variety of data sources and file formats. "
                }
            },{
                "@type": "Question",
                "name": " What type is a DataFrame in pandas? ",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": " In pandas, a DataFrame is of the type pandas.core.frame.DataFrame. 
import pandas as pddf = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})print(type(df))  # Output: &amp;lt;class 'pandas.core.frame.DataFrame'&amp;gt;"
                }
            }]
            }
            </script>

<!-- schema for the searchBox -->
<script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "WebSite",
        "url": "https://www.geeksforgeeks.org/",
        "potentialAction": {
            "@type": "SearchAction",
            "target": "https://www.geeksforgeeks.org/search/{search_term_string}/",
            "query-input": "required name=search_term_string"
        }
    }
</script>


<script>
    var arrPostCat = new Array();
    var arrPostCatName="AIMLDS";
            arrPostCat.push('9172');
            arrPostCat.push('1789');
        var tIds = "9172,1789,2963,3107,2971";
    var termsNames = "AIMLDS,Python,ProgrammingLanguage,Picked,PythonpandasdataFrame,Pythonpandas";
    var tIdsInclusiveParents = "9172,1789,2963,3107,2971,2056"
    var domain = 1;
    var arrPost = new Array();
    var post_id = "242709";
    var post_type = "post";
    var post_slug = window.location.href;
    var ip = "64.252.70.114";
    var post_title = "Different ways to create Pandas Dataframe";
    var post_status = "publish";
    var practiceAPIURL="https://practiceapi.geeksforgeeks.org/";
    var practiceURL="https://practice.geeksforgeeks.org/";
    var post_date = "2018-11-14 00:25:10";
    var commentSysUrl = "https://discuss.geeksforgeeks.org/commentEmbedV2.js";
    //var postAdApiUrlString = "";
    var link_on_code_run = '';
    var link_search_modal_top = '';
    
    
        var postAdApiUrlString = '2056/9172/1789/2963/3107/2971/';
</script>




<!-- This site is optimized with the Yoast SEO plugin v7.6 - https://yoast.com/wordpress/plugins/seo/ -->
<meta name="description" content="A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions."/>
<link rel="canonical" href="https://www.geeksforgeeks.org/different-ways-to-create-pandas-dataframe/" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Different ways to create Pandas Dataframe - GeeksforGeeks" />
<meta property="og:description" content="A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions." />
<meta property="og:url" content="https://www.geeksforgeeks.org/different-ways-to-create-pandas-dataframe/" />
<meta property="og:site_name" content="GeeksforGeeks" />
<meta property="article:tag" content="Picked" />
<meta property="article:tag" content="Python pandas-dataFrame" />
<meta property="article:tag" content="Python-pandas" />
<meta property="article:section" content="AI-ML-DS" />
<meta property="article:published_time" content="2018-11-14T00:25:10+00:00" />
<meta property="article:modified_time" content="2024-07-05T16:05:52+00:00" />
<meta property="og:updated_time" content="2024-07-05T16:05:52+00:00" />
<script type='application/ld+json'>{"@context":"https:\/\/schema.org","@type":"Organization","url":"https:\/\/www.geeksforgeeks.org\/","sameAs":[],"@id":"https:\/\/www.geeksforgeeks.org\/#organization","name":"GeeksforGeeks","logo":"http:\/\/www.geeksforgeeks.org\/wp-content\/uploads\/gfg_200X200-1.png"}</script>
<!-- / Yoast SEO plugin. -->

<link rel='dns-prefetch' href='//www.geeksforgeeks.org' />
<link rel='dns-prefetch' href='//s.w.org' />
		<script type="text/javascript">
			window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/www.geeksforgeeks.org\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.9.8"}};
			!function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55358,56760,9792,65039],[55358,56760,8203,9792,65039]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i<j.length;i++)c.supports[j[i]]=e(j[i]),c.supports.everything=c.supports.everything&&c.supports[j[i]],"flag"!==j[i]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[j[i]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(h=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",h,!1),a.addEventListener("load",h,!1)):(a.attachEvent("onload",h),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),g=c.source||{},g.concatemoji?f(g.concatemoji):g.wpemoji&&g.twemoji&&(f(g.twemoji),f(g.wpemoji)))}(window,document,window._wpemojiSettings);
		</script>
		<style type="text/css">
img.wp-smiley,
img.emoji {
	display: inline !important;
	border: none !important;
	box-shadow: none !important;
	height: 1em !important;
	width: 1em !important;
	margin: 0 .07em !important;
	vertical-align: -0.1em !important;
	background: none !important;
	padding: 0 !important;
}
</style>
<link rel='stylesheet' id='custom-style-css'  href='https://www.geeksforgeeks.org/wp-content/themes/iconic-one/css/gfg.min.css?ver=11.41' type='text/css' media='all' />
<script type='text/javascript' src='https://code.jquery.com/jquery-3.6.3.min.js?ver=3.6.3'></script>
<script type='text/javascript' src='https://code.jquery.com/jquery-migrate-3.0.0.min.js?ver=3.0.0'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var gfgObject = {"authUrl":"https:\/\/auth.geeksforgeeks.org\/","writeApiUrl":"https:\/\/apiwrite.geeksforgeeks.org\/","writeUrl":"https:\/\/write.geeksforgeeks.org\/","utilUrl":"https:\/\/util.geeksforgeeks.org\/","apiUrl":"https:\/\/api.geeksforgeeks.org\/","cfApiUrl":"https:\/\/gfgapi.geeksforgeeks.org\/","baseCompilerURL":"https:\/\/codejudge.geeksforgeeks.org\/","idePageBaseUrl":"https:\/\/ide.geeksforgeeks.org\/","gfgApiScriptUrl":"https:\/\/apiscript.geeksforgeeks.org\/","gfgSiteUrl":"https:\/\/www.geeksforgeeks.org\/","curatedListId":"1","curatedListTitle":"SDE Sheet Problems","utilDjangoCfUrl":"https:\/\/utilapi.geeksforgeeks.org\/","premiumCheckoutSlug":"premium-plans-payment\/","premiumLandingSlug":"premium-plans\/","premiumCssUrl":"https:\/\/www.geeksforgeeks.org\/wp-content\/themes\/iconic-one\/css\/gfgpremium.min.css?ver=1.5","premiumJsUrl":"https:\/\/www.geeksforgeeks.org\/wp-content\/themes\/iconic-one\/js\/gfgpremium.min.js?ver=1.3","utilGoogleUrl":"https:\/\/ugprod.geeksforgeeks.org\/","communityApiUrl":"https:\/\/communityapi.geeksforgeeks.org\/","utilDjangoUrl":"https:\/\/gfgutil.geeksforgeeks.org\/","gfgPracticeUrl":"https:\/\/practiceapi.geeksforgeeks.org\/","gfgMediaUrl":"https:\/\/media.geeksforgeeks.org\/","gfgMlApiUrl":"https:\/\/recommendations.geeksforgeeks.org\/","userlevelPremiumPlus":"2"};
/* ]]> */
</script>
<script type='text/javascript' async="async" src='https://www.geeksforgeeks.org/wp-content/themes/iconic-one/js/gfg.min.js?ver=12.94'></script>

<link rel='shortlink' href='https://www.geeksforgeeks.org/?p=242709' />
<style>
#wpadminbar{
background: #ff0000 !important;
}
</style>
<style type="text/css" id="custom-background-css">
body.custom-background { background-color: #ffffff; }
</style>
<link rel="icon" href="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200-100x100.png" sizes="32x32" />
<link rel="icon" href="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png" sizes="192x192" />
<link rel="apple-touch-icon-precomposed" href="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png" />
<meta name="msapplication-TileImage" content="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png" />

<!--
<script type='text/javascript'>
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];
  (function() {
    var gads = document.createElement('script');
    gads.async = true;
    gads.type = 'text/javascript';
    var useSSL = 'https:' == document.location.protocol;
    gads.src = (useSSL ? 'https:' : 'http:') +
      '//www.googletagservices.com/tag/js/gpt.js';
    var node = document.getElementsByTagName('script')[0];
    node.parentNode.insertBefore(gads, node);
  })();
</script>

 AutoAds
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-9465609616171866",
enable_page_level_ads: true
});
</script>
-->




<style>

#internal-promo-section{
  display: none !important;
}

@media (max-width:1043px) and (min-width:992px) {
 .hide-1043992 {
   display: none!important;
 }
}

.mobile-header-list-item{
    padding-left:30px; 
    padding-right:10px;
    margin-top:5px;
}

.mobile-header-list{
    border-bottom: 1px solid rgba(158, 158, 158, 0.3) !important;
}

.mobile-header-list .dropdown-title{
    border-bottom: none !important;
    font-size: 16px!important; 
    padding: 0px!important; 
    padding-left: 45px!important; 
    font-weight: normal;
}

.mobile-header-list .upside::after{
    transform: rotate(180deg);
}

</style>
<!-- End Google Tag Manager -->
<!-- Global site tag (gtag.js) - Google Ads: 474915276 -->
<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=AW-474915276"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'AW-474915276');
</script> -->

</head>

<body class="post-template-default single single-post postid-242709 single-format-standard custom-background custom-background-white">

    <script>
        // Dark mode script

        const gfgThemeList = Object.freeze({
            LIGHT: "gfgThemeLight",
            DARK: "gfgThemeDark"
        })
        const getThemeFromCookie = () => {
            let gfg_def_theme = "";
            let cookies = document.cookie;
            let cooks = cookies.split(";");
        
            for (let i = 0; i < cooks.length; i++) {   
                let icook = cooks[i].split("=");
                if (icook[0].trim() == "gfg_theme") {
                    gfg_def_theme = icook[1].trim();
                }
            }
            return gfg_def_theme
        }
        if(!(post_slug.includes('premium-plans-payment/') || post_slug.includes('premium-plans/'))){
            var isDarkMode = getThemeFromCookie() == gfgThemeList.DARK ? true : false;
            document.querySelector("body").setAttribute("data-dark-mode", isDarkMode);
        }
 

        function setSearchBarFocus() {
          const myTimeout = setTimeout(searchBarFocus, 0);
          function searchBarFocus() {
            document.getElementById("gcse-search-input").focus();
          }
        }

        
    </script>

    <!-- <div class="header-main__wrapper not-fixed"> -->
    <nav>
    <div class="header-main__wrapper">

        <a class="gfg-stc" style="top:0" href="#main">Skip to content</a>

        <a href="https://www.geeksforgeeks.org/" aria-label="Logo" class="header-main__logo">
            <div class="_logo">
                <!-- Original Logo -->
                <img class="gfg_logo_img" style="height: 30px; width: 80px; max-width: fit-content;" src="https://media.geeksforgeeks.org/gfg-gg-logo.svg" alt="geeksforgeeks">
            </div>
        </a>
        <div class="header-main__container">
            <!-- for mobile only -->
            
        <!-- For Web view only -->
        <ul class="header-main__list"><li class="header-main__list-item Header_1" data-parent="false" aria-expanded="true" data-expandable="true"><span>Tutorials</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Tutorial</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/taking-input-in-python/?ref=outind" target="_self">Taking Input in Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-operators/?ref=outind" target="_self">Python Operators</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Data Types</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-numbers/?ref=outind" target="_self">Python Numbers</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-string/?ref=outind" target="_self">Python String</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-lists/?ref=outind" target="_self">Python Lists</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-tuples/?ref=outind" target="_self">Python Tuples</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sets-in-python/?ref=outind" target="_self">Sets in Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-dictionary/?ref=outind" target="_self">Python Dictionary</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Loops and Control Flow</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python3-if-if-else-nested-if-if-elif-statements/?ref=outind" target="_self">Python Conditional Statements</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/loops-in-python/?ref=outind" target="_self">Python Loops</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-functions/?ref=outind" target="_self">Python Functions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-oops-concepts/?ref=outind" target="_self">Python OOPS Concept</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Data Structures</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-data-structures-and-algorithms/?ref=outind" target="_self">Python DSA</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-linked-list/?ref=outind" target="_self">Linked List</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/stack-in-python/?ref=outind" target="_self">Stack</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/queue-in-python/?ref=outind" target="_self">Queue</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/binary-tree-data-structure/?ref=outind" target="_self">Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-heap-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Heap</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-hashing-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Hashing</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-graphs-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Graph</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-set-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Sets</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-map-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Map</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/advanced-data-structures/?ref=outind" target="_self">Advance Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sorting-algorithms-in-python/?ref=outind" target="_self">Sorting Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/searching-algorithms/?ref=outind" target="_self">Searching Algorithms</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-exception-handling/?ref=outind" target="_self">Python Exception Handling</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/file-handling-python/?ref=outind" target="_self">Python File Handling</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Exercises</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-list-exercise/?ref=outind" target="_self">Python List Exercise</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-string-exercise/?ref=outind" target="_self">Python String Exercise</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-tuple-exercise/?ref=outind" target="_self">Python Tuple Exercise</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-dictionary-exercise/?ref=outind" target="_self">Python Dictionary Exercise</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-set-exercise/?ref=outind" target="_self">Python Set Exercise</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-design-patterns/?ref=outind" target="_self">Python Design Patterns</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-programming-examples/?ref=outind" target="_self">Python Programming Examples</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-exercises-practice-questions-and-solutions/?ref=outind" target="_self">Python Practice Questions</a></li></ul></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Programming Language</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java/?ref=outind" target="_self">Java Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-types-in-java/?ref=outind" target="_self">Data Types</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/variables-in-java/?ref=outind" target="_self">Variables</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/operators-in-java/?ref=outind" target="_self">Operators</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/decision-making-javaif-else-switch-break-continue-jump/?ref=outind" target="_self">Flow Control in Java</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/loops-in-java/?ref=outind" target="_self">Loops in Java</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/methods-in-java/?ref=outind" target="_self">Methods</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/strings-in-java/?ref=outind" target="_self">Strings</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/arrays-in-java/?ref=outind" target="_self">Arrays</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>OOPs Concepts</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_4"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/object-oriented-programming-oops-concept-in-java/?ref=outind" target="_self">OOPs Concepts</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/classes-objects-java/?ref=outind" target="_self">Classes and Objects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/access-modifiers-java/?ref=outind" target="_self">Access Modifiers</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/inheritance-in-java/?ref=outind" target="_self">Inheritance</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/abstraction-in-java-2/?ref=outind" target="_self">Abstraction</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/encapsulation-in-java/?ref=outind" target="_self">Encapsulation</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/polymorphism-in-java/?ref=outind" target="_self">Polymorphism</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/interfaces-in-java/?ref=outind" target="_self">Interface</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/packages-in-java/?ref=outind" target="_self">Packages</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/multithreading-in-java/?ref=outind" target="_self">Multithreading</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/file-handling-in-java/?ref=outind" target="_self">File Handling</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/regular-expressions-in-java/?ref=outind" target="_self">Regular Expression</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Collections</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/collections-in-java-2/?ref=outind" target="_self">Java Collections</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/collections-class-in-java/?ref=outind" target="_self">Collection Class</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/list-interface-java-examples/?ref=outind" target="_self">List Interface</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/arraylist-in-java/?ref=outind" target="_self">ArrayList</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linked-list-in-java/?ref=outind" target="_self">LinkedList Class</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/queue-interface-java/?ref=outind" target="_self">Queue Interface</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/set-in-java/?ref=outind" target="_self">Set Interface</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hashset-in-java/?ref=outind" target="_self">HashSet Class</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/map-interface-java-examples/?ref=outind" target="_self">Map Interface</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-util-hashmap-in-java-with-examples/?ref=outind" target="_self">HashMap Class</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hashtable-in-java/?ref=outind" target="_self">HashTable Class</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/iterators-in-java/?ref=outind" target="_self">Iterator</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/comparator-interface-java/?ref=outind" target="_self">Comparator</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-collections-interview-questions/?ref=outind" target="_self">Collection Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-8-features/?ref=outind" target="_self">Java 8 Tutorial</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Programs</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-programming-examples/?ref=outind" target="_self">Java Programming Examples</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-array-programs/?ref=outind" target="_self">Java Array Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-string-programs/?ref=outind" target="_self">Java String Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-date-time-programs/?ref=outind" target="_self">Java Date-Time Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-file-handling-programs/?ref=outind" target="_self">Java File Handling Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-collection-programs/?ref=outind" target="_self">Java Collection Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-jdbc-programs/?ref=outind" target="_self">Java JDBC Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-apache-poi-programs/?ref=outind" target="_self">Java Apache POI Programs</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-opencv-programs/?ref=outind" target="_self">Java OpenCV Programs</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Interview Questions</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-interview-questions/?ref=outind" target="_self">Java Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/core-java-interview-questions-for-freshers/?ref=outind" target="_self">Core Java Interview Questions-Freshers</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-20-java-multithreading-interview-questions-answers/?ref=outind" target="_self">Java Multithreading Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/oops-interview-questions/?ref=outind" target="_self">OOPs Interview Questions and Answers</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-exercises/?ref=outind" target="_self">Java Exercises</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Quiz</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/quizzes/50-java-language-mcqs-with-answers-2/?ref=outind" target="_self">Java Quiz</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-multiple-choice-questions/?ref=outind" target="_self">Core Java MCQ</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-projects/?ref=outind" target="_self">Java Projects</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Advance Java</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring/?ref=outind" target="_self">Spring Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-boot/?ref=outind" target="_self">Spring Boot Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-boot-interview-questions/?ref=outind" target="_self">Spring Boot Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-mvc/?ref=outind" target="_self">Spring MVC Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-mvc-interview-questions/?ref=outind" target="_self">Spring MVC Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hibernate-tutorial/?ref=outind" target="_self">Hibernate Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hibernate-interview-questions/?ref=outind" target="_self">Hibernate Interview Questions</a></li></ul></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Programming Languages</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/c-programming-language/?ref=outind" target="_self">C</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/c-plus-plus/?ref=outind" target="_self">C++</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/learn-javascript-js-roadmap-for-beginners/?ref=outind" target="_self">JavaScript</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/php-tutorial/?ref=outind" target="_self">PHP</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/r-tutorial/?ref=outind" target="_self">R Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/csharp-programming-language/?ref=outind" target="_self">C#</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sql-tutorial/?ref=outind" target="_self">SQL</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/scala-programming-language/?ref=outind" target="_self">Scala</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/perl-programming-language/?ref=outind" target="_self">Perl</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/golang/?ref=outind" target="_self">Go Language</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/kotlin-programming-language/?ref=outind" target="_self">Kotlin</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>System Design</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>System Design Tutorial</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/what-is-system-design-learn-system-design/?ref=outind" target="_self">What is System Design</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/important-key-concepts-and-terminologies-learn-system-design/?ref=outind" target="_self">Key Terminologies in System Design</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/analysis-of-monolithic-and-distributed-systems-learn-system-design/?ref=outind" target="_self">Analysis and Architecture of Systems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/what-is-scalability-and-how-to-achieve-it-learn-system-design/?ref=outind" target="_self">Scalability in System Design</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/complete-reference-to-databases-in-designing-systems/?ref=outind" target="_self">Databases in System Design</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/what-is-high-level-design-learn-system-design/?ref=outind" target="_self">High Level Design or HLD</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/what-is-low-level-design-or-lld-learn-system-design/?ref=outind" target="_self">Low Level Design or LLD</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-10-system-design-interview-questions-and-answers/?ref=outind" target="_self">Case Studies in Designing Systems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/system-design-tutorial/?ref=outind" target="_self">Complete System Design Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-design-patterns/?ref=outind" target="_self">Software Design Patterns</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/complete-roadmap-to-learn-system-design/?ref=outind" target="_self">System Design Roadmap</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-10-system-design-interview-questions-and-answers/?ref=outind" target="_self">Top 10 System Design Interview Questions and Answers</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Interview Corner</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/company-preparation/?ref=outind" target="_self">Company Preparation</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/interview-preparation-for-software-developer/?ref=outind" target="_self">Top Topics</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://practice.geeksforgeeks.org/company-tags/?ref=outind" target="_self">Practice Company Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/company-interview-corner/?ref=outind" target="_self">Interview Experiences</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/experienced-interview-experiences-company-wise/?ref=outind" target="_self">Experienced Interviews</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/internship-interview-experiences-company-wise/?ref=outind" target="_self">Internship Interviews</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind" target="_self">Competitive Programming</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/quiz-corner-gq/?ref=outind" target="_self">Multiple Choice Quizzes</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outind" target="_self">Aptitude for Placements</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Computer Science Subjects</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/operating-systems/?ref=outind" target="_self">Operating System</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/dbms/?ref=outind" target="_self">DBMS</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outind" target="_self">Computer Networks</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outind" target="_self">Engineering Mathematics</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/?ref=outind" target="_self">Computer Organization and Architecture</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/theory-of-computation-automata-tutorials/?ref=outind" target="_self">Theory of Computation</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/compiler-design-tutorials/?ref=outind" target="_self">Compiler Design</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/#blg/?ref=outind" target="_self">Digital Logic</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-engineering/?ref=outind" target="_self">Software Engineering</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>DevOps</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/git-tutorial/?ref=outind" target="_self">GIT</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/aws-tutorial/?ref=outind" target="_self">AWS</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/docker-tutorial/?ref=outind" target="_self">Docker</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outind" target="_self">Kubernetes</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/microsoft-azure/?ref=outind" target="_self">Microsoft Azure Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outind" target="_self">Google Cloud Platform</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Linux</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-tutorial/?ref=outind" target="_self">Linux Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-commands/?ref=outind" target="_self">Linux Commands A-Z</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-commands-cheat-sheet/?ref=outind" target="_self">Linux Commands Cheatsheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/permissions-in-linux/?ref=outind" target="_self">File Permission Commands</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/beginners-guide-to-linux-system-administration/?ref=outind" target="_self">Linux System Administration</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-file-system/?ref=outind" target="_self">Linux File System</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-linux-shell-shell-scripting/?ref=outind" target="_self">Linux Shell Scripting</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/network-configuration-trouble-shooting-commands-linux/?ref=outind" target="_self">Linux Networking</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-interview-questions/?ref=outind" target="_self">Linux Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Software Testing</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outind" target="_self">Software Testing Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-engineering/?ref=outind" target="_self">Software Engineering Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-testing-interview-questions/?ref=outind" target="_self">Testing Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/jira-tutorial/?ref=outind" target="_self">Jira</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Databases</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/dbms/?ref=outind" target="_self">DBMS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sql-tutorial/?ref=outind" target="_self">SQL Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/postgresql-tutorial/?ref=outind" target="_self">PostgreSQL Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mongodb-tutorial/?ref=outind" target="_self">MongoDB Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sql-interview-questions/?ref=outind" target="_self">SQL Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mysql-interview-questions/?ref=outind" target="_self">MySQL Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/pl-sql-interview-questions/?ref=outind" target="_self">PL/SQL Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Android</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/android-tutorial/?ref=outind" target="_self">Android Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/android-studio-tutorial/?ref=outind" target="_self">Android Studio Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/kotlin-android-tutorial/?ref=outind" target="_self">Kotlin For Android</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/android-projects-from-basic-to-advanced-level/?ref=outind" target="_self">Android Projects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-50-android-interview-questions-answers-sde-i-to-sde-iii/?ref=outind" target="_self">Android Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/6-weeks-of-android-app-development-free-project-based-learning/?ref=outind" target="_self">6 Weeks of Android App Development</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Excel</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/excel-tutorial/?ref=outind" target="_self">MS Excel Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-ms-excel/?ref=outind" target="_self">Introduction to MS Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-analysis-in-excel/?ref=outind" target="_self">Data Analysis in Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/basic-excel-formulas-and-functions/?ref=outind" target="_self">Basic Excel Formulas & Functions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/instant-data-analysis-in-advanced-excel/?ref=outind" target="_self">Data Analysis in Advanced Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/workbooks-in-microsoft-excel/?ref=outind" target="_self">Workbooks</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/statistical-functions-in-excel-with-examples/?ref=outind" target="_self">Statistical Functions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-visualization-in-excel/?ref=outind" target="_self">Data Visualization in Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/pivot-tables-in-excel/?ref=outind" target="_self">Pivot Tables in Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/working-with-excel-spreadsheets-in-python/?ref=outind" target="_self">Excel Spreadsheets in Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/basic-excel-shortcuts/?ref=outind" target="_self">Basic Excel Shortcuts</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Mathematics</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/number-theory/?ref=outind" target="_self">Number System</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/algebra/?ref=outind" target="_self">Algebra</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linear-algebra/?ref=outind" target="_self">Linear Algebra</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/math-trigonometry/?ref=outind" target="_self">Trigonometry</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/set-theory/?ref=outind" target="_self">Set Theory</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/statistics/?ref=outind" target="_self">Statistics</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/probability-in-maths/?ref=outind" target="_self">Probability</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/geometry/?ref=outind" target="_self">Geometry</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mensuration/?ref=outind" target="_self">Mensuration</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/logarithms/?ref=outind" target="_self">Logarithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/math-calculus/?ref=outind" target="_self">Calculus</a></li></ul></li></ul></li><li class="header-main__list-item Header_2" data-parent="false" aria-expanded="true" data-expandable="true"><span>DSA</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Structures</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/complete-guide-to-arrays-data-structure/?ref=outind" target="_self">Arrays</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-matrix-or-grid-data-structure-and-algorithms-tutorial/?ref=outind" target="_self">Matrix</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/complete-guide-to-string-data-structure/?ref=outind" target="_self">Strings</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Linked List</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/singly-linked-list-definition-meaning-dsa/?ref=outind" target="_self">Singly Linked List</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-and-insertion-in-a-doubly-linked-list/?=ref=outind" target="_self">Doubly Linked List</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/circular-linked-list/?ref=outind" target="_self">Circular Linked List</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/insertion-in-doubly-circular-linked-list/?ref=outind" target="_self">Doubly Circular Linked List</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-linked-list-data-structure-and-algorithm-tutorial/?ref=outind" target="_self">Linked List Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-stack-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Stack</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-queue-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Queue</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Tree</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/generic-treesn-array-trees/?ref=outind" target="_self">Generic Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-binary-tree-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Binary Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-binary-search-tree-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Binary Search Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-avl-tree/?ref=outind" target="_self">AVL Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-of-b-tree-2/?ref=outind" target="_self">B Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-of-b-tree/?ref=outind" target="_self">B+ Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-red-black-tree/?ref=outind" target="_self">Red Black Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-tree-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Tree Data Structure Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-heap-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Heap</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-hashing-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Hashing</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-graphs-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Graph</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-set-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Set Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-map-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Map Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/advanced-data-structures/?ref=outind" target="_self">Advanced Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-data-structures/?ref=outind" target="_self">Data Structures Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Analysis of Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/design-and-analysis-of-algorithms/?ref=outind" target="_self">Design and Analysis of Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/asymptotic-notation-and-analysis-based-on-input-size-of-algorithms/?ref=outind" target="_self">Asymptotic Analysis</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/types-of-asymptotic-notations-in-complexity-analysis-of-algorithms/?ref=outind" target="_self">Asymptotic Notations</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/worst-average-and-best-case-analysis-of-algorithms/?ref=outind" target="_self">Worst, Average and Best Cases</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Searching Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linear-search/?ref=outind" target="_self">Linear Search</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/binary-search/?ref=outind" target="_self">Binary Search</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/searching-algorithms/?ref=outind" target="_self">Searching Algorithms Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Sorting Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/selection-sort/?ref=outind" target="_self">Selection Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bubble-sort/?ref=outind" target="_self">Bubble Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/insertion-sort/?ref=outind" target="_self">Insertion Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/merge-sort/?ref=outind" target="_self">Merge Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/quick-sort/?ref=outind" target="_self">Quick Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/heap-sort/?ref=outind" target="_self">Heap Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/counting-sort/?ref=outind" target="_self">Counting Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/radix-sort/?ref=outind" target="_self">Radix Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bucket-sort-2/?ref=outind" target="_self">Bucket Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-sorting-algorithm/?ref=outind" target="_self">Sorting Algorithms Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-greedy-algorithm-data-structures-and-algorithm-tutorials/?ref=outind" target="_self">Greedy Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-dynamic-programming-data-structures-and-algorithm-tutorials/?ref=outind" target="_self">Dynamic Programming</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-graphs-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Graph Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-pattern-searching-data-structure-and-algorithm-tutorial/?ref=outind" target="_self">Pattern Searching</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-recursion-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Recursion</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-backtracking-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Backtracking</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-divide-and-conquer-algorithm-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Divide and Conquer</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mathematical-algorithms/?ref=outind" target="_self">Mathematical Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/geometric-algorithms/?ref=outind" target="_self">Geometric Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-bitwise-algorithms-data-structures-and-algorithms-tutorial/?ref=outind" target="_self">Bitwise Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/randomized-algorithms/?ref=outind" target="_self">Randomized Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-branch-and-bound-data-structures-and-algorithms-tutorial/?ref=outind" target="_self">Branch and Bound</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-algorithms/?ref=outind" target="_self">Algorithms Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outind" target="_self">DSA Tutorial</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Practice</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">All DSA Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/problem-of-the-day?itm_source=geeksforgeeksitm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Problem of the Day</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Company Wise Coding Practice</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&company=Amazon&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Amazon</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&company=Microsoft&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Microsoft</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&company=Flipkart&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Flipkart</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Explore All</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&curated[]=1&sortBy=submissions&curated_names[]=SDE Sheet?itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">GfG SDE Sheet</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Practice Problems Difficulty Wise</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=School&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">School</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Basic&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Basic</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Easy&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Easy</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Medium&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Medium</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Hard&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Hard</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Language Wise Coding Practice</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&category=CPP&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">CPP</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&category=Java&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Java</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?category=python&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Python</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Curated DSA Lists</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=ca8ae412173dbd8346c26a0295d098fd&sortBy=submissions&sprint_name=Beginner's DSA Sheet&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Beginner's DSA Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=50746f92a895c22a50504ac0c1fb9c84&sortBy=submissions&sprint_name=Top 50 Array Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 Array Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=57184072610b884e5df3584cc534115d&sortBy=submissions&sprint_name=Top 50 String Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 String Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=93d672753b74440c7427214c8ebf866d&sortBy=submissions&sprint_name=Top 50 DP Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 DP Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=405e9db0f353691ad3b2d546b19145e9&sortBy=submissions&sprint_name=Top 50 Graph Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 Graph Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=5f24de84b65bf7c4f4399c8111e26b81&sortBy=submissions&sprint_name=Top 50 Tree Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 Tree Problems</a></li></ul></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind" target="_self">Competitive Programming</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Company Wise SDE Sheets</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/facebookmeta-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Facebook SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/amazon-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Amazon SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/apple-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Apple SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/netflix-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Netflix SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/google-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Google SDE Sheet</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>DSA Cheat Sheets</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/?ref=outind" target="_self">SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/most-asked-dsa-interview-problems-for-beginners/?ref=outind" target="_self">DSA Sheet for Beginners</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/must-do-coding-questions-for-companies-like-amazon-microsoft-adobe/?ref=outind" target="_self">FAANG Coding Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/must-do-coding-questions-for-product-based-companies/?ref=outind" target="_self">Product-Based Coding Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/must-coding-questions-company-wise/?ref=outind" target="_self">Company-Wise Preparation Sheet</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outind" target="_self">Top Interview Questions</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Puzzles</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/puzzles/?ref=outind" target="_self">All Puzzles</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-100-puzzles-asked-in-interviews/?ref=outind" target="_self">Top 100 Puzzles Asked In Interviews</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-20-puzzles-commonly-asked-during-sde-interviews/?ref=outind" target="_self">Top 20 Puzzles Commonly Asked During SDE Interviews</a></li></ul></li></ul></li><li class="header-main__list-item Header_3" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Science</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-programming-language/?ref=outind" target="_self">Python Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/r-tutorial/?ref=outind" target="_self">R Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/machine-learning/?ref=outind" target="_self">Machine Learning</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-science-with-python-tutorial/?ref=outind" target="_self">Data Science using Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/r-programming-for-data-science/?ref=outind" target="_self">Data Science using R</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Science Packages</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/pandas-tutorial/?ref=outind" target="_self">Pandas Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/numpy-tutorial/?ref=outind" target="_self">NumPy Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Visualization</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outind" target="_self">Python Data Visualization Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-visualization-in-r/?ref=outind" target="_self">Data Visualization with R</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Analysis</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-analysis-with-python/?ref=outind" target="_self">Data Analysis with Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-analysis-using-r/?ref=outind" target="_self">Data Analysis with R</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outind" target="_self">Deep Learning</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outind" target="_self">NLP Tutorial</a></li></ul></li><li class="header-main__list-item Header_4" data-parent="false" aria-expanded="true" data-expandable="true"><span>Web Tech</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/html-tutorial/?ref=outind" target="_self">HTML Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/css-tutorial/?ref=outind" target="_self">CSS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/javascript/?ref=outind" target="_self">JavaScript Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/php-tutorial/?ref=outind" target="_self">PHP Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/react-tutorial/?ref=outind" target="_self">ReactJS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/nodejs/?ref=outind" target="_self">NodeJS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-angularjs/?ref=outind" target="_self">AngularJS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bootstrap/?ref=outind" target="_self">Bootstrap Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/typescript/?ref=outind" target="_self">Typescript</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Web Development Using Python</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Django</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/django-tutorial/?ref=outind" target="_self">Django Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-django-projects-for-beginners/?ref=outind" target="_self">Django Projects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/django-interview-questions/?ref=outind" target="_self">Django Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Flask</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/flask-tutorial/?ref=outind" target="_self">Flask Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/flask-projects/?ref=outind" target="_self">Flask Projects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/flask-interview-questions-and-answers/?ref=outind" target="_self">Flask Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/postman-tutorial/?ref=outind" target="_self">Postman</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-github/?ref=outind" target="_self">Github</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/wordpress-tutorial/?ref=outind" target="_self">Wordpress Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/web-design/?ref=outind" target="_self">Web Design</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Cheat Sheets</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/html-cheat-sheet-a-basic-guide-to-html/?ref=outind" target="_self">HTML Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/css-cheat-sheet-a-basic-guide-to-css/?ref=outind" target="_self">CSS Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/javascript-cheat-sheet-a-basic-guide-to-javascript/?ref=outind" target="_self">JavaScript Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/react-cheat-sheet/?ref=outind" target="_self">React Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/angular-cheat-sheet-a-basic-guide-to-angular/?ref=outind" target="_self">Angular Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/jquery-cheat-sheet-a-basic-guide-to-jquery/?ref=outind" target="_self">jQuery Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bootstrap-cheatsheet-a-basic-guide-to-bootstrap/?ref=outind" target="_self">Bootstrap Cheat Sheet</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/web-development/?ref=outind" target="_self">Learn Complete Web Development</a></li></ul></li><li class="header-main__list-item Header_5" data-parent="false" aria-expanded="true" data-expandable="true"><span>Courses</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/coding-for-everyone?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Coding for Everyone</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/dsa-to-development-coding-guide?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">DSA to Development</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/data-science-live?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Machine Learning & Data Science</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/mastering-generative-ai-and-chat-gpt?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Generative AI & ChatGPT</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/search?query=AWS&itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Become AWS Certified</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>DSA Courses</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/dsa-self-paced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Data Structure & Algorithm(C++/JAVA)</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/Data-Structures-With-Python?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Data Structure & Algorithm(Python)</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/data-structures-and-algorithms-in-javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Data Structure & Algorithm(JavaScript)</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Programming Languages</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/cpp-programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">CPP</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/Java-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Java</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/Python-Foundation?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">JavaScript</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/c-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">C</a></li></ul></li></ul></li></ul>
        <!-- right now only search is visible for mobile view because of css and all are visible for web view -->
            <ul class="header-main__left-list" data-nl="false">
                <li class="header-main__left-list-item gcse-search_li p-relative" aria-expanded="false" data-expandable="false">
                    <div class="gcse-form-search-suggestion_wrapper">
                        <form id="gcse-form" class="gcse-form_class p-relative" data-sm="false">
                            <span class="front-search-icon"><i class="gfg-icon gfg-icon_search gfg-icon_white gcse-search__icon gcse-search-icon_grey"></i> </span>
                            <input class="gcse-search-input__wrapper" id="gcse-search-input" aria-expanded="false" placeholder="Search..." autocomplete="off" />
                            <i class="gfg-icon gfg-icon_times gfg-icon_white hide-search"></i>
                            <button  aria-label="search" type="submit" class="gcse-search__btn not-expanded">
                                <i class="gfg-icon gfg-icon_search gfg-icon_white gcse-search__icon"></i>
                            </button>
                        </form>
                        <div class="gfg-search-suggestion_wrapper" style="display:none"></div>
                    <div>
                </li>
                                <li>
                    <div class="darkMode-wrap" data-mode="Switch to Dark Mode">
                        <button aria-label="toggle theme" data-gfg-action="toggleGFGTheme">
                            <div id="darkMode-wrap-red-dot" style="height:12px;width:12px;background-color:#EB2222;border-radius:999999px;position:absolute;top:4px;right:0;display:none;"></div>
                            <i class="gfg-icon gfg-icon_dark-mode"></i>
                        </button>
                        <span id="darkModeTooltipText"></span>
                    </div>
                </li>
                
                <li class="header-main__left-list-item google-translate-parent-element" aria-expanded="false" data-expanded="true">
                    <div class="translate" id="g_translater">
                        <div id="google_translate_element" data-show="false"></div>
                    </div>
                    <i class ="gfg-icon gfg-icon_translate googleTranslateToggle" data-gfg-action="google_translate_element"></i>
                    <!-- removed below code from here to load google translate js dynamically -->
                    <!-- <script>
                        var m = false;
                        function googleTranslateElementInit() {
                            new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
                            setTimeout(function(){
                                if (jQuery( window ).width() < 768){
                                    m = true;
                                     jQuery('#g_translater').detach().appendTo('#google_translate_mobile');                            
                                }
                            }, 7000);
                        }
                        jQuery( window ).resize(function() {
                            if (jQuery( window ).width() < 768 && m == false){
                                m = true;
                                jQuery('#g_translater').detach().appendTo('#google_translate_mobile');  
                            } else if (jQuery( window ).width() >= 768 && m == true){
                                m = false;
                                jQuery('#g_translater').detach().prependTo('.google-translate-parent-element');                            
                            }
                        });
                    </script> -->
                </li>
                <li id="userProfileId" class="header-main__left-list-item p-relative" aria-expanded="false" data-expandable="false">
                    <!-- Profile Section to be added via JS -->
                </li>
                            </ul>
        </div>

        <!-- for mobile only -->
        
        <!-- for mobile only -->
               
       </div>
    </nav>
    <div class="header-main__slider">
        <button aria-label="sub header slider previous" class="header-main__slider-arrow previous hideIt">
            <i class="gfg-icon gfg-icon_arrow-left gicon-centered"></i>
        </button>
        <ul id="hslider">
        <li><div class="header-main__slider-sticky">
    <button id="related-article-button" data-gfg-action="article-slider" aria-label="Related Articles"><div class="mobile-view-leftbar-icon" aria-label="Related Articles" alt="Related Articles"></div>
    <style>#darkMode-wrap-red-dot-leftbar{animation: pulse-animation 1.3s infinite;}@keyframes pulse-animation{0%{box-shadow: 0 0 0 0px rgba(249, 179, 0, 0.5);}100%{box-shadow: 0 0 0 10px rgba(249, 179, 0, 0);}}</style>
    <div id="darkMode-wrap-red-dot-leftbar" style="display: none;height: 8px;width: 8px;background-color: #fb0101;border-radius: 999999px;position: absolute;top: 10px;right: 12px;animation: pulse-animation 1.3s infinite;"></div></button>
    
               <div class="header-main__slider-flex">
                    <div class="header-main__slider-flex-inner" title="Related articles" data-gfg-action="article-slider"></div>
                </div>
               </div></li><li><a href="https://www.geeksforgeeks.org/ai-ml-ds/?ref=shm">AI ML DS</a></li><li><a href="https://www.geeksforgeeks.org/data-science-for-beginners/?ref=shm">Data Science</a></li><li><a href="https://www.geeksforgeeks.org/what-is-data-analysis/?ref=shm">Data Analysis</a></li><li><a href="https://www.geeksforgeeks.org/data-visualization-and-its-importance/?ref=shm">Data Visualization</a></li><li><a href="https://www.geeksforgeeks.org/what-is-machine-learning/?ref=shm">Machine Learning</a></li><li><a href="https://www.geeksforgeeks.org/introduction-deep-learning/?ref=shm">Deep Learning</a></li><li><a href="https://www.geeksforgeeks.org/natural-language-processing-overview/?ref=shm">NLP</a></li><li><a href="https://www.geeksforgeeks.org/computer-vision-introduction/?ref=shm">Computer Vision</a></li><li><a href="https://www.geeksforgeeks.org/artificial-intelligence/?ref=shm">Artificial Intelligence</a></li><li><a href="https://www.geeksforgeeks.org/ai-ml-ds-interview/?ref=shm">AI ML DS Interview Series</a></li><li><a href="https://www.geeksforgeeks.org/ai-ml-ds-projects/?ref=shm">AI ML DS Projects series</a></li><li><a href="https://www.geeksforgeeks.org/how-to-become-a-data-engineer/?ref=shm">Data Engineering</a></li><li><a href="https://www.geeksforgeeks.org/introduction-to-web-scraping/?ref=shm">Web Scrapping</a></li>        </ul>
        <button aria-label="sub header slider next" class="header-main__slider-arrow next hideIt">
            <i class="gfg-icon gfg-icon_arrow-right gicon-centered"></i>
        </button>
    </div>
    <button id="scrollTopBtn" title="Scroll to Top" type="button" class="btn btn-success">&#x25B2;</button>
    <!-- .top-spacing to give space on single pages-->
    <div id="main" class="wrapper single-page">

<script>
    if(post_slug.includes('premium-plans-payment/') || post_slug.includes('premium-plans/')){
        $(".header-main__slider").remove();
    }
    //getting tags for the page type data
    let mobileView = false;
    let pageTags = JSON.parse('null');
    let allTags = JSON.parse('["AIMLDS","Python","ProgrammingLanguage","Picked","PythonpandasdataFrame","Pythonpandas"]');
</script>
<script>
    window.have_dsa_term = false;
    // var practiceTab = ; 
</script>

<style>
    .wrapper {
        flex-direction: column !important;
    }
    /* spinner css */
    @keyframes spinner {
        to {transform: rotate(360deg);}
    }
    
    .spinner:before {
        content: '';
        box-sizing: border-box;
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin-top: -10px;
        margin-left: -10px;
        border-radius: 50%;
        border: 2px solid #ccc;
        border-top-color: #000;
        animation: spinner .6s linear infinite;
    }

    .report-loader{
        position: relative;
        
    }

    .report-loader.spinner{
        margin-left: 16px;
    }
    .badges{
        display: flex;
        align-items: center;
        position: relative;
    }
    .badges .gfg-badge-icon.md::after{
        transform: scale(0.25);
        position:relative;
        top: 2px;
        left: -2px;
    }
    .sep{
        margin: 0px 5px;
        font-size: 20px;
        color: var(--badge-name-color);
    }
    .pub-count{
        font-size: 14px;
        font-family: var(--font-secondary);
    }
    .badge-details{
        display:none;
    }
    .badges{
        cursor: pointer;
        position: relative;
        /* width: 0px;
        height: 20px;
        top: -32px; */
    }
    .badge-icon{
        display: flex;
        align-items: center;
    }
    .badge-content{
        margin-left: 9px;
    }
    .badge-name{
        color: var(--badge-nam-color);
        font-weight: 600;
        font-size: 16px;
        text-transform: capitalize;
    }
    .badge-data{
        color: #A5A4A4;
        font-size: 10px;
    }
    .badges:hover .badge-details{
        display: block;
        background: var(--badge-bg);
        padding: 10px 18px 10px 18px;
        position: absolute;
        width: 175px;
        top: -10px;
        z-index: 10;
        left: 112%;
        box-shadow: rgb(100 100 111 / 20%) 0px 7px 29px 0px;
        border-radius: 5px;
        /* transform-origin: top right; */
    }
    .badge-details::before {
        content: "";
        position: absolute;
        transform: rotate(90deg);
        /* transform-origin: right; */
        left: -6px;
        top: 50%;
        margin-left: -17px;
        border-width: 12px;
        border-style: solid;
        border-color: var(--badge-bg) transparent transparent transparent;
        margin-top: -12px;
    }
    .badge-icon .icon{
        border: 1px solid var(--icon-border-color);
        padding: 4px 3px;
        border-radius: 4px;
        width: 22px;
        height: 24px;
        position: relative;
    }
    .b-icon-pos{
        position: relative;
        top: -34px;
        left: -34px;
    }
    /* article viewer */
    .article--viewer .a-wrapper{
        margin-top: 0px !important;
    }
    .content{
        padding-top: 10px !important;
    }
    .u-name{
        font-size: 14px;
    }
    .article--viewer_content .a-wrapper .content{
        padding-bottom: 10px !important;
    }
    .likeTooltipBottom{
        font-size: 14px;
    }
    @media (max-width: 434px) {
        .article-buttons.show-bg{
            margin-top: 56px !important;
        }
    }
    @media (max-width: 730px),
            ((min-width: 992px) and (max-width:1100px))  {
        .article--viewer .media{
            position: relative;
        }
        .article--viewer .media{
            margin-bottom: 0px !important;
        }
        .badges:hover .badge-details{
            top: -56px;
            left: 62px;
        }
        .badge-details::before{
            transform: rotate(0deg);
            left: 10%;
            top: 117%;
        }
        .article-buttons.show-bg{
            margin-top: 22px;
            top: 0px !important;
        }
    }
    @media ((min-width:731px) and (max-width:1223px)) {
        .article-buttons.show-bg{
            top: 18px;
        }
    }
    @media ((min-width:993px) and (max-width:1190px)) {
        .article--viewer .media{
            position: relative;
        }
        .article--viewer .media{
            margin-bottom: 25px !important;
        }
    }
</style>
<!-- Survey modal implementation -->
<script>
    function getCookie(name) {
        function escape(s) { return s.replace(/([.*+?\^$(){}|\[\]\/\\])/g, '\\$1'); }
        var match = document.cookie.match(RegExp('(?:^|;\\s*)' + escape(name) + '=([^;]*)'));
        return match ? match[1] : null;
    }
</script>
<!-- END Survey modal implementation-->

<!-- Open in App Button and CSS-->

<!-- Above code is for old openInApp pop-up with open in app and continue buttons-->

<div id='openInApp-modal' class='openInApp'>
    <a href = 'https://geeksforgeeksapp.page.link/?link=https://www.geeksforgeeks.org/different-ways-to-create-pandas-dataframe/?type%3Darticle%26id%3D242709&apn=free.programming.programming&isi=1641848816&ibi=org.geeksforgeeks.GeeksforGeeksDev&efr=1' class='openInAppLink'>
        <span style='color: #fff;'>Open In App</span>
    </a>
</div>
    <script>
        var consentValue = localStorage.getItem("gfg_cc");
        var isIOS = !!navigator.platform && /iPad|iPhone|iPod|MacIntel/.test(navigator.platform) && navigator.maxTouchPoints > 0;
        const isSafari = navigator.userAgent.indexOf("Safari") > -1;
        const isMozilla = navigator.userAgent.indexOf("Mozilla") > -1;
        if(consentValue){
            if(window.innerHeight > window.innerWidth && navigator.maxTouchPoints > 1 && (isSafari || isMozilla || navigator.userAgentData.mobile)){
                $('.openInApp').css({
                    display: "block"
                });
                $('#scrollTopBtn').css({
                    bottom: "44px"
                });
                //adding a new class to check stats for clicks on iOS and Android
                isIOS ? jQuery('.openInAppLink').addClass("oia-iOS") : $('.openInAppLink').addClass("oia-android");      //for openInApp Link
            }
        }
        
    </script>
    <style>
        .openInApp{
            display: none;
            bottom: 0px;
            width: 100%;
            position: fixed;
            z-index: 1025;
            opacity: 0.93;
        }
        .openInAppLink{
            height: 44px;
            background: var(--color-gfg);
            font-weight: bold;
            display: block;
            text-align: center;
            padding: 12px;
            font-size: large;
        }
        .openInAppLink, .openInAppLink:hover, .openInAppLink:active, .openInAppLink:visited, .openInAppLink:focus {
            text-decoration:none;
        }
    </style>
<!-- END Open in App Button and CSS-->

            <script>
                companyTagsArray = JSON.parse('[]');
                categoryTagsArray = JSON.parse('["python"]');
            </script>
            <div class="container-fluid bg-light" id="home-page" style="position: relative; max-width:100%;">
    <div class="article-page_flex">
            <div class="sidebar_wrapper  manual_leftbar ">
        <div class="sideBar sticky" >
                <div class="sideBar--wrap newLeftbar oinLeftbar ">
                <ul class="leftBarList"><div class='second'><li><a href="https://www.geeksforgeeks.org/pandas-practice-excercises-questions-and-solutions/?ref=lbp">Pandas Exercises and Programs</a></li><li class="currentpage"><a href="https://www.geeksforgeeks.org/different-ways-to-create-pandas-dataframe/?ref=lbp">Different ways to create Pandas Dataframe</a></li><div class="leftbar-dropdown"><h2 class="dropdown-title">Pandas DataFrame Practice Exercises<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/create-a-pandas-dataframe-from-lists/?ref=lbp">Create a Pandas DataFrame from Lists</a></li><li><a href="https://www.geeksforgeeks.org/make-a-pandas-dataframe-with-two-dimensional-list-python/?ref=lbp">Make a Pandas DataFrame with two-dimensional list | Python</a></li><li><a href="https://www.geeksforgeeks.org/python-creating-dataframe-from-dict-of-narray-lists/?ref=lbp">Python | Creating DataFrame from dict of narray/lists</a></li><li><a href="https://www.geeksforgeeks.org/creating-pandas-dataframe-using-list-of-lists/?ref=lbp">Creating Pandas dataframe using list of lists</a></li><li><a href="https://www.geeksforgeeks.org/creating-a-pandas-dataframe-using-list-of-tuples/?ref=lbp">Creating a Pandas dataframe using list of tuples</a></li><li><a href="https://www.geeksforgeeks.org/create-a-pandas-dataframe-from-list-of-dicts/?ref=lbp">Create a Pandas DataFrame from List of Dicts</a></li><li><a href="https://www.geeksforgeeks.org/python-convert-list-of-nested-dictionary-into-pandas-dataframe/?ref=lbp">Python | Convert list of nested dictionary into Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/replace-values-in-pandas-dataframe-using-regex/?ref=lbp">Replace values in Pandas dataframe using regex</a></li><li><a href="https://www.geeksforgeeks.org/creating-a-dataframe-from-pandas-series/?ref=lbp">Creating a dataframe from Pandas series</a></li><li><a href="https://www.geeksforgeeks.org/construct-a-dataframe-in-pandas-using-string-data/?ref=lbp">Construct a DataFrame in Pandas using string data</a></li><li><a href="https://www.geeksforgeeks.org/clean-the-string-data-in-the-given-pandas-dataframe/?ref=lbp">Clean the string data in the given Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/reindexing-in-pandas-dataframe/?ref=lbp">Reindexing in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/mapping-external-values-to-dataframe-values-in-pandas/?ref=lbp">Mapping external values to dataframe values in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/reshape-a-pandas-dataframe-using-stackunstack-and-melt-method/?ref=lbp">Reshape a Pandas DataFrame using stack,unstack and melt method</a></li><li><a href="https://www.geeksforgeeks.org/reset-index-in-pandas-dataframe/?ref=lbp">Reset Index in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/python-change-column-names-and-row-indexes-in-pandas-dataframe/?ref=lbp">Change column names and row indexes in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/how-to-print-an-entire-pandas-dataframe-in-python/?ref=lbp">How to print an entire Pandas DataFrame in Python?</a></li><li><a href="https://www.geeksforgeeks.org/working-with-missing-data-in-pandas/?ref=lbp">Working with Missing Data in Pandas</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Pandas Dataframe Rows Practice Exercise<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-iterate-over-rows-in-pandas-dataframe/?ref=lbp">How to iterate over rows in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/different-ways-to-iterate-over-rows-in-pandas-dataframe/?ref=lbp">Different ways to iterate over rows in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/selecting-rows-in-pandas-dataframe-based-on-conditions/?ref=lbp">Selecting rows in pandas DataFrame based on conditions</a></li><li><a href="https://www.geeksforgeeks.org/select-any-row-from-a-dataframe-using-iloc-and-iat-in-pandas/?ref=lbp">Select any row from a Dataframe using iloc[] and iat[] in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/limited-rows-selection-with-given-column-in-pandas-python/?ref=lbp">Limited rows selection with given column in Pandas | Python</a></li><li><a href="https://www.geeksforgeeks.org/drop-rows-from-the-dataframe-based-on-certain-condition-applied-on-a-column/?ref=lbp">Drop rows from the dataframe based on certain condition applied on a column</a></li><li><a href="https://www.geeksforgeeks.org/insert-row-at-given-position-in-pandas-dataframe/?ref=lbp">Insert row at given position in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/create-a-list-from-rows-in-pandas-dataframe/?ref=lbp">Create a list from rows in Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/create-a-list-from-rows-in-pandas-dataframe-set-2/?ref=lbp">Create a list from rows in Pandas DataFrame | Set 2</a></li><li><a href="https://www.geeksforgeeks.org/ranking-rows-of-pandas-dataframe/?ref=lbp">Ranking Rows of Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/sorting-rows-in-pandas-dataframe/?ref=lbp">Sorting rows in pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/select-row-with-maximum-and-minimum-value-in-pandas-dataframe/?ref=lbp">Select row with maximum and minimum value in Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/get-all-rows-in-a-pandas-dataframe-containing-given-substring/?ref=lbp">Get all rows in a Pandas DataFrame containing given substring</a></li><li><a href="https://www.geeksforgeeks.org/convert-a-column-to-row-name-index-in-pandas/?ref=lbp">Convert a column to row name/index in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-randomly-select-rows-from-pandas-dataframe/?ref=lbp">How to randomly select rows from Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/how-to-print-an-entire-pandas-dataframe-in-python/?ref=lbp">How to print an entire Pandas DataFrame in Python?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Pandas Dataframe Columns Practice Exercise<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/create-a-pandas-column-using-for-loop/?ref=lbp">Create a pandas column using for loop</a></li><li><a href="https://www.geeksforgeeks.org/how-to-get-column-names-in-pandas-dataframe/?ref=lbp">How to Get Column Names in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-rename-columns-in-pandas-dataframe/?ref=lbp">How to rename columns in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/collapse-multiple-columns-in-pandas/?ref=lbp">Collapse multiple Columns in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/get-unique-values-from-a-column-in-pandas-dataframe/?ref=lbp">Get unique values from a column in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/conditional-operation-on-pandas-dataframe-columns/?ref=lbp">Conditional operation on Pandas DataFrame columns</a></li><li><a href="https://www.geeksforgeeks.org/return-the-index-label-if-some-condition-is-satisfied-over-a-column-in-pandas-dataframe/?ref=lbp">Return the Index label if some condition is satisfied over a column in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/using-dictionary-to-remap-values-in-pandas-dataframe-columns/?ref=lbp">Using dictionary to remap values in Pandas DataFrame columns</a></li><li><a href="https://www.geeksforgeeks.org/formatting-integer-column-of-dataframe-in-pandas/?ref=lbp">Formatting float column of Dataframe in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/create-a-new-column-in-pandas-dataframe-based-on-the-existing-columns/?ref=lbp">Create a new column in Pandas DataFrame based on the existing columns</a></li><li><a href="https://www.geeksforgeeks.org/python-creating-a-pandas-dataframe-column-based-on-a-given-condition/?ref=lbp">Python | Creating a Pandas dataframe column based on a given condition</a></li><li><a href="https://www.geeksforgeeks.org/split-a-column-in-pandas-dataframe-and-get-part-of-it/?ref=lbp">Split a column in Pandas dataframe and get part of it</a></li><li><a href="https://www.geeksforgeeks.org/getting-unique-values-from-a-column-in-pandas-dataframe/?ref=lbp">Getting Unique values from a column in Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/split-a-string-into-columns-using-regex-in-pandas-dataframe/?ref=lbp">Split a String into columns using regex in pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/getting-frequency-counts-of-a-columns-in-pandas-dataframe/?ref=lbp">Getting frequency counts of a columns in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/change-data-type-for-one-or-more-columns-in-pandas-dataframe/?ref=lbp">Change Data Type for one or more columns in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/split-a-text-column-into-two-columns-in-pandas-dataframe/?ref=lbp">Split a text column into two columns in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/difference-of-two-columns-in-pandas-dataframe/?ref=lbp">Difference of two columns in Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/get-the-index-of-maximum-value-in-dataframe-column/?ref=lbp">Get the index of maximum value in DataFrame column</a></li><li><a href="https://www.geeksforgeeks.org/get-the-index-of-minimum-value-in-dataframe-column/?ref=lbp">Get the index of minimum value in DataFrame column</a></li><li><a href="https://www.geeksforgeeks.org/get-n-largest-values-from-a-particular-column-in-pandas-dataframe/?ref=lbp">Get n-largest values from a particular column in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/get-n-smallest-values-from-a-particular-column-in-pandas-dataframe/?ref=lbp">Get n-smallest values from a particular column in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/how-to-drop-one-or-multiple-columns-in-pandas-dataframe/?ref=lbp">How to drop one or multiple columns in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/how-to-lowercase-column-names-in-pandas-dataframe/?ref=lbp">How to lowercase strings in a column in Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/capitalize-first-letter-of-a-column-in-pandas-dataframe/?ref=lbp">Capitalize first letter of a column in Pandas dataframe</a></li><li><a href="https://www.geeksforgeeks.org/apply-uppercase-to-a-column-in-pandas-dataframe/?ref=lbp">Apply uppercase to a column in Pandas dataframe</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Pandas Series Practice Exercise<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/create-a-pandas-series-from-array/?ref=lbp">Create a Pandas Series from array</a></li><li><a href="https://www.geeksforgeeks.org/creating-a-pandas-series-from-dictionary/?ref=lbp">Creating a Pandas Series from Dictionary</a></li><li><a href="https://www.geeksforgeeks.org/creating-a-pandas-series-from-lists/?ref=lbp">Creating a Pandas Series from Lists</a></li><li><a href="https://www.geeksforgeeks.org/create-pandas-series-using-numpy-functions/?ref=lbp">Create Pandas Series using NumPy functions</a></li><li><a href="https://www.geeksforgeeks.org/access-the-elements-of-a-series-in-pandas/?ref=lbp">Access the elements of a Series in Pandas</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Pandas Date and Time Practice Exercise<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/pandas-time-series-manipulation/?ref=lbp">Basic of Time Series Manipulation Using Pandas</a></li><li><a href="https://www.geeksforgeeks.org/using-timedelta-and-period-to-create-datetime-based-indexes-in-pandas/?ref=lbp">Using Timedelta and Period to create DateTime based indexes in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/convert-the-column-type-from-string-to-datetime-format-in-pandas-dataframe/?ref=lbp">Convert the column type from string to datetime format in Pandas dataframe</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">DataFrame String Manipulation<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/extract-punctuation-from-the-specified-column-of-dataframe-using-regex/?ref=lbp">Extract punctuation from the specified column of Dataframe using Regex</a></li><li><a href="https://www.geeksforgeeks.org/replace-missing-white-spaces-in-a-string-with-the-least-frequent-character-using-pandas/?ref=lbp">Replace missing white spaces in a string with the least frequent character using Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-convert-floats-to-strings-in-pandas-dataframe/?ref=lbp">How to Convert Floats to Strings in Pandas DataFrame?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Accessing and Manipulating Data in DataFrame<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/access-index-of-last-element-in-pandas-dataframe-in-python/?ref=lbp">Access Index of Last Element in pandas DataFrame in Python</a></li><li><a href="https://www.geeksforgeeks.org/replace-characters-in-strings-in-pandas-dataframe/?ref=lbp">Replace Characters in Strings in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/replace-values-of-a-dataframe-with-the-value-of-another-dataframe-in-pandas/?ref=lbp">Replace values of a DataFrame with the value of another DataFrame in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/replace-negative-values-with-latest-preceding-positive-value-in-pandas-dataframe/?ref=lbp">Replace negative values with latest preceding positive value in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/how-to-add-column-from-another-dataframe-in-pandas/?ref=lbp">How to add column from another DataFrame in Pandas ?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">DataFrame Visualization and Exporting<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-render-pandas-dataframe-as-html-table/?ref=lbp">How to render Pandas DataFrame as HTML Table?</a></li><li><a href="https://www.geeksforgeeks.org/exporting-pandas-dataframe-to-json-file/?ref=lbp">Exporting Pandas DataFrame to JSON File</a></li><li><a href="https://www.geeksforgeeks.org/create-and-display-a-one-dimensional-array-like-object-using-pandas-in-python/?ref=lbp">Create and display a one-dimensional array-like object using Pandas in Python</a></li><li><a href="https://www.geeksforgeeks.org/export-pandas-dataframe-to-a-csv-file/?ref=lbp">Export Pandas dataframe to a CSV file</a></li><li><a href="https://www.geeksforgeeks.org/display-the-pandas-dataframe-in-heatmap-style/?ref=lbp">Display the Pandas DataFrame in Heatmap style</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Data Aggregation and Grouping<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-sum-negative-and-positive-values-using-groupby-in-pandas/?ref=lbp">How to sum negative and positive values using GroupBy in Pandas?</a></li><li><a href="https://www.geeksforgeeks.org/pandas-groupby-value-counts-on-the-dataframe/?ref=lbp">Pandas - Groupby value counts on the DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/how-to-count-unique-values-in-a-pandas-groupby-object/?ref=lbp">How to count unique values in a Pandas Groupby object?</a></li><li><a href="https://www.geeksforgeeks.org/how-to-add-group-level-summary-statistic-as-a-new-column-in-pandas/?ref=lbp">How to Add Group-Level Summary Statistic as a New Column in Pandas?</a></li><li><a href="https://www.geeksforgeeks.org/find-the-profit-and-loss-in-the-given-excel-sheet-using-pandas/?ref=lbp">Find the profit and loss in the given Excel sheet using Pandas</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Merging and Joining<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/prevent-duplicated-columns-when-joining-two-pandas-dataframes/?ref=lbp">Prevent duplicated columns when joining two Pandas DataFrames</a></li><li><a href="https://www.geeksforgeeks.org/how-to-merge-dataframes-of-different-length-in-pandas/?ref=lbp">How to Merge DataFrames of different length in Pandas ?</a></li><li><a href="https://www.geeksforgeeks.org/join-pandas-dataframes-matching-by-substring/?ref=lbp">Join Pandas DataFrames matching by substring</a></li><li><a href="https://www.geeksforgeeks.org/merge-two-pandas-dataframes-based-on-closest-datetime/?ref=lbp">Merge two Pandas DataFrames based on closest DateTime</a></li><li><a href="https://www.geeksforgeeks.org/merge-two-pandas-dataframes-on-certain-columns/?ref=lbp">Merge two Pandas DataFrames on certain columns</a></li><li><a href="https://www.geeksforgeeks.org/merge-two-pandas-dataframes-by-matched-id-number/?ref=lbp">Merge two Pandas dataframes by matched ID number</a></li><li><a href="https://www.geeksforgeeks.org/merge-two-dataframes-with-same-column-names/?ref=lbp">Merge two dataframes with same column names</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Filtering and Selecting Data<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/drop-specific-rows-from-multiindex-pandas-dataframe/?ref=lbp">Drop specific rows from multiindex Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/select-rows-that-contain-specific-text-using-pandas/?ref=lbp">Select rows that contain specific text using Pandas</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Select Rows With Multiple Filters in Pandas<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/select-pandas-dataframe-rows-between-two-dates/?ref=lbp">Select Pandas dataframe rows between two dates</a></li><li><a href="https://www.geeksforgeeks.org/filter-pandas-dataframe-with-multiple-conditions/?ref=lbp">Filter Pandas Dataframe with multiple conditions</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Selection and Slicing<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-take-column-slices-of-dataframe-in-pandas/?ref=lbp">How to take column-slices of DataFrame in Pandas?</a></li><li><a href="https://www.geeksforgeeks.org/extract-all-capital-words-from-dataframe-in-pandas/?ref=lbp">Extract all capital words from Dataframe in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-reverse-the-column-order-of-the-pandas-dataframe/?ref=lbp">How to reverse the column order of the Pandas DataFrame?</a></li><li><a href="https://www.geeksforgeeks.org/check-if-a-column-starts-with-given-string-in-pandas-dataframe/?ref=lbp">Check if a column starts with given string in Pandas DataFrame?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Miscellaneous DataFrame Operations<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-display-most-frequent-value-in-a-pandas-series/?ref=lbp">How to display most frequent value in a Pandas series?</a></li><li><a href="https://www.geeksforgeeks.org/set-pandas-dataframe-background-color-and-font-color-in-python/?ref=lbp">Set Pandas dataframe background Color and font color in Python</a></li><li><a href="https://www.geeksforgeeks.org/how-to-widen-output-display-to-see-more-columns-in-pandas-dataframe/?ref=lbp">How to widen output display to see more columns in Pandas dataframe?</a></li><li><a href="https://www.geeksforgeeks.org/get-the-day-from-a-date-in-pandas/?ref=lbp">Get the day from a date in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/get-the-hour-from-timestamp-in-pandas/?ref=lbp">Get the Hour from timestamp in Pandas</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Data Cleaning and Manipulation<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-fill-nan-values-with-mean-in-pandas/?ref=lbp">How to fill NAN values with mean in Pandas?</a></li><li><a href="https://www.geeksforgeeks.org/fillna-in-multiple-columns-in-place-in-python-pandas/?ref=lbp">Fillna in multiple columns in place in Python Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-remove-random-symbols-in-a-dataframe-in-pandas/?ref=lbp">How to remove random symbols in a dataframe in Pandas?</a></li><li><a href="https://www.geeksforgeeks.org/replace-negative-number-by-zeros-in-pandas-dataframe/?ref=lbp">Replace Negative Number by Zeros in Pandas DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/align-columns-to-left-in-pandas-python/?ref=lbp">Align columns to Left in Pandas - Python</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Concatenation and Manipulation<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/read-multiple-csv-files-into-separate-dataframes-in-python/?ref=lbp">Read multiple CSV files into separate DataFrames in Python</a></li><li><a href="https://www.geeksforgeeks.org/append-list-of-dictionary-and-series-to-a-existing-pandas-dataframe-in-python/?ref=lbp">Append list of dictionary and series to a existing Pandas DataFrame in Python</a></li><li><a href="https://www.geeksforgeeks.org/concatenate-multiindex-into-single-index-in-pandas-series/?ref=lbp">Concatenate multiIndex into single index in Pandas Series</a></li><li><a href="https://www.geeksforgeeks.org/concatenate-strings-from-several-rows-using-pandas-groupby/?ref=lbp">Concatenate strings from several rows using Pandas groupby</a></li><li><a href="https://www.geeksforgeeks.org/split-large-pandas-dataframe-into-list-of-smaller-dataframes/?ref=lbp">Split large Pandas Dataframe into list of smaller Dataframes</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">DataFrame Sorting and Reordering<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/how-to-sort-a-pandas-dataframe-by-date/?ref=lbp">How to Sort a Pandas DataFrame by Date?</a></li><li><a href="https://www.geeksforgeeks.org/rename-specific-columns-in-pandas/?ref=lbp">Rename specific column(s) in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-rename-multiple-column-headers-in-a-pandas-dataframe/?ref=lbp">How to rename multiple column headers in a Pandas DataFrame?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">DataFrame Transformation and Conversion<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/get-the-first-3-rows-of-a-given-dataframe/?ref=lbp">Get the first 3 rows of a given DataFrame</a></li><li><a href="https://www.geeksforgeeks.org/how-to-convert-pandas-dataframe-columns-to-a-series/?ref=lbp">How to Convert Pandas DataFrame columns to a Series?</a></li><li><a href="https://www.geeksforgeeks.org/how-to-convert-index-in-a-column-of-the-pandas-dataframe/?ref=lbp">How to convert index in a column of the Pandas dataframe?</a></li><li><a href="https://www.geeksforgeeks.org/how-to-add-header-row-to-a-pandas-dataframe/?ref=lbp">How to add header row to a Pandas Dataframe?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">DataFrame Filtering and Selection<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/select-a-single-column-of-data-as-a-series-in-pandas/?ref=lbp">Select a single column of data as a Series in Pandas</a></li><li><a href="https://www.geeksforgeeks.org/how-to-select-single-column-of-a-pandas-dataframe/?ref=lbp">How to Select single column of a Pandas Dataframe?</a></li><li><a href="https://www.geeksforgeeks.org/ways-to-filter-pandas-dataframe-by-column-values/?ref=lbp">Filter Pandas Dataframe by Column Value</a></li><li><a href="https://www.geeksforgeeks.org/how-to-filter-dataframe-rows-based-on-the-date-in-pandas-2/?ref=lbp">How to Filter DataFrame Rows Based on the Date in Pandas?</a></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">DataFrame Conversion and Reshaping<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li><a href="https://www.geeksforgeeks.org/convert-a-series-of-date-strings-to-a-time-series-in-pandas-dataframe/?ref=lbp">Convert a series of date strings to a time series in Pandas Dataframe</a></li><li><a href="https://www.geeksforgeeks.org/split-pandas-dataframe-by-rows/?ref=lbp">Split Pandas Dataframe by Rows</a></li><li><a href="https://www.geeksforgeeks.org/how-to-convert-a-dictionary-to-a-pandas-series/?ref=lbp">How to convert a dictionary to a Pandas series?</a></li><li><a href="https://www.geeksforgeeks.org/flatten-a-list-of-dataframes/?ref=lbp">Flatten a list of DataFrames</a></li><li><a href="https://www.geeksforgeeks.org/convert-birth-date-to-age-in-pandas/?ref=lbp">Convert birth date to age in Pandas</a></li></ul></div></div></ul></div><div id="GFG_AD_Desktop_LeftSideBar_Docked_300x250"></div>            </div>
             <div id="GFG_AD_Desktop_LeftSideBar_Docked_160x600" style="max-width:160px; max-height:600px"></div>
        </div>
            <div class="leftBar">
            <div class="article--viewer">
                <div class="article--viewer_content">
                    <div class="a-wrapper">
                        <div class="" style="z-index:9999 !important;position:relative;">
                        </div>
                        <article class="content post-242709 post type-post status-publish format-standard hentry category-ai-ml-ds category-python tag-picked tag-python-pandas-dataframe tag-python-pandas" id="post-242709">
                                                                                   <!-- when comment system will be scalable from practice side then we will display  Article/Discussion tab-->
                            <div class="main_wrapper" style="display:flex;">
                                                                <div style="width: 100%;">
                                        <div class="article-title">
                                            <h1>Different ways to create Pandas Dataframe</h1>
                                        </div>
                                                                                    <div style="margin-top: 3px;font-family:var(--font-primary);color:var(--gfg-color-lg);font-size:16px;">
                                                <span class="strong">Last Updated : </span>
                                                <span>05 Jul, 2024</span>
                                            </div>
                                                                            </div>
                                                                
                                 <!-- three dot menu -->
                                <div class="three_dot_dropdown">                                     <div style="display: flex;">
                                                                                             <div pid="242709" ptitle="Different ways to create Pandas Dataframe" class="article--viewer_comment tooltip top-comment-icon-div">
                                                    <span class="comment_tooltiptext">Comments</span>
                                                    <div class="three_dot_dropdown_div" data-gfg-action='loadComments' style="margin-top: 15px;">
                                                        <div class="comment_header">
                                                          <i class= "discussion_button" style="position: relative; transform: scale(0.9);"></i>
                                                        </div>
                                                    </div>
                                                </div>
                                                                                         <div pid="242709" ptitle="Different ways to create Pandas Dataframe" class="article--viewer_improve tooltip">
                                                <span class="improve_tooltiptext">Improve</span>
                                                <div class="three_dot_dropdown_div three_dot_dropdown_improve" onclick="improveArticleCall()" style="margin-top: 15px;">
                                                    <div class="improve_wrapper_top">
                                                      <i class="gfg-icon gfg-icon-pencil  gfg-icon_edit" style="position: relative; z-index: 3;"></i>
                                                    </div>
                                                </div>
<!-- <button onclick="improveArticleCall()">
                                                    <i class="gfg-icon gfg-icon_edit"></i>
                                                </button> -->
                                                </div>                                     <!-- three dots -->
                                    <ul class="dropbtn icons btn-right showLeft" onclick="showDropdown()">
                                        <li>
                                                                                            <span class="darkMode-wrap-yellow-dot"></span>
                                                                                    </li>
                                        <li></li>
                                        <li></li>
                                    </ul>
                                  </div>
                                </div> 
                            </div>
                            <!-- menu -->
                            <div id="myDropdown" class="three_dot_dropdown_content">
                                        <div class="article-buttons drop" onmouseleave="closeKebabMenu()">
                                            <!-- If the status of the summary API is true than we are showing the summarize button otherwise not  -->
                                                                                            <div class="article--viewer_report tooltip login-modal-btn">
                                                    <div class="three_dot_dropdown_div three_dot_dropdown_reportarticle">
                                                        <div class="three_dot_dropdown_inner_div show_summary" data-gfg-action="report-article" style="display: flex;align-items: center;">
                                                        <span class="darkMode-wrap-yellow-dot" style="position:absolute;top:2px;right:4px;"></span>
                                                            <i class="premium-gfg-icon premium-gfg-icon_report"></i>
                                                            <span>Summarize</span>
                                                        </div>
                                                    </div>
                                                </div>
                                                                                         <div pid="242709" ptitle="Different ways to create Pandas Dataframe" class="improve_article--viewer tooltip">
                                                <div class="three_dot_dropdown_div three_dot_dropdown_improve" onclick="suggestionArticleCall()" style="margin-top: 1px;">
                                                    <div class="three_dot_dropdown_inner_div improve_dot_dropdown_inner_div">
                                                        <i class="gfg-icon gfg-icon_suggest_changes gfg-icon_edit"></i>
                                                        <span>Suggest changes</span>
                                                    </div>
                                                </div>
                                            </div>                                                                                          <div pid="242709" class="article--viewer_like tooltip">
                                            <div class="three_dot_dropdown_div three_dot_dropdown_likearticle" onmouseleave='toggleLikeElementVisibility("showLikesContainer", false)'  onmouseenter='toggleLikeElementVisibility("showLikesContainer", true)'>
                                                    <div class="showLikesContainer"> 
                                                        <span class="likeTooltip">Like Article</span>
                                                    </div>
                                                    <div class="three_dot_dropdown_inner_div" data-gfg-action="like-article" data-bookmark-value="0">
                                                        <i class="gfg-icon gfg-icon_thumbs"></i>
                                                        <span>Like</span>
                                                    </div>
                                                </div>
<!-- <button data-gfg-action="like-article" data-bookmark-value="0">
                                                    <i class="gfg-icon gfg-icon_thumbs"></i>
                                                </button> -->
                                            </div>
                                            <div pid="242709" class="article--viewer_bookmark tooltip">
                                                <div class="three_dot_dropdown_div three_dot_dropdown_save">
                                                    <div class="three_dot_dropdown_inner_div" data-gfg-action="bookmark-article" data-bookmark-value="0">
                                                        <i class="gfg-icon gfg-icon_bookmark"></i>
                                                        <span>Save</span>
                                                    </div>
                                                </div>
<!-- <button data-gfg-action="bookmark-article" data-bookmark-value="0">
                                                    <i class="gfg-icon gfg-icon_bookmark"></i>
                                                </button> -->
                                            </div>
                                            <div pid="242709" class="article--viewer_share tooltip">
                                                <div class="three_dot_dropdown_div three_dot_dropdown_share" onmouseleave="closeShareModal()" onmouseenter="openShareModal()">
                                                    <div style="display: flex;align-items: center;" class="three_dot_dropdown_inner_div" data-gfg-action="share-article" data-bookmark-value="0">
                                                        <i class="gfg-share-icon"></i>
                                                        <span>Share</span>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="article--viewer_report tooltip">
                                                <div class="three_dot_dropdown_div three_dot_dropdown_reportarticle">
                                                    <div class="three_dot_dropdown_inner_div" data-gfg-action="report-article" onclick="report_article();">
                                                        <i class="gfg-icon gfg-icon_report"></i>
                                                        <span>Report</span>
                                                    </div>
                                                </div>
<!-- <button data-gfg-action="like-article" data-bookmark-value="0">
                                                    <i class="gfg-icon gfg-icon_thumbs"></i>
                                                </button> -->
                                            </div>
                                        </div>
                                    </div>
                            <div class="text">
                                                                <p dir="ltr"><span> It is the most commonly used Pandas object.&nbsp;The pd. </span><b><strong> DataFrame() function </strong></b><span> is used to create a DataFrame in </span><a href="https://www.geeksforgeeks.org/pandas-tutorial/" target="_blank" rel="noopener"><span> Pandas </span></a><span> . You can also create Pandas DataFrame in multiple ways. There are several ways to create a </span><a href="https://www.geeksforgeeks.org/python-pandas-dataframe/" rel="noopener"><span> Pandas Dataframe </span></a><span> in </span><a href="https://www.geeksforgeeks.org/python-programming-language/" rel="noopener"><span> Python </span></a><span> . You can create a DataFrame with the following methods: </span></p>
<div id="table_of_content"><h2 style="margin:4px; font-size:20px; font-weight:bold;"> Different Ways to Create Dataframe in Python </h2><ul><li><a href="#pandas-dataframe-syntax"> Pandas Dataframe() Syntax </a></li><li><a href="#create-an-empty-dataframe-using-dataframe-method"> Create an Empty DataFrame using DataFrame() Method </a></li><li><a href="#create-dataframe-from-lists-of-lists"> Create DataFrame from lists of lists </a></li><li><a href="#create-dataframe-from-dictionary-of-ndarraylists"> Create DataFrame from Dictionary of &nbsp;ndArray/Lists </a></li><li><a href="#create-dataframe-from-list-of-dictionaries"> Create DataFrame from List of Dictionaries </a></li><li><a href="#create-dataframe-from-a-dictionary-of-series"> Create DataFrame from a dictionary of Series </a></li><li><a href="#create-dataframe-using-the-zip-function"> Create DataFrame using the zip() function </a></li><li><a href="#create-a-dataframe-by-proving-the-index-label-explicitly"> Create a DataFrame by proving the index label explicitly </a></li><li><a href="#different-ways-to-create-pandas-dataframe-faqs"> FAQs </a></li></ul></div><h2 id="pandas-dataframe-syntax"><span> Pandas Create Dataframe Syntax </span></h2><blockquote><p dir="ltr"><b><strong> pandas.DataFrame(data, index, columns) </strong></b></p><div id="GFG_AD_gfg_mobile_336x280" style="margin: 5px 0;" data-lazy-loading="true"></div>
</blockquote><h3><b><strong> Parameters: </strong></b></h3><ul><li value="1"><b><strong> data </strong></b><span> : It is a dataset from which a DataFrame is to be created. It can be a list, dictionary, scalar value, series, and arrays, etc. </span></li><li value="2"><b><strong> index </strong></b><span> : It is optional, by default the index of the DataFrame starts from 0 and ends at the last data value(n-1). It defines the row label explicitly. </span></li><li value="3"><b><strong> columns </strong></b><span> : This parameter is used to provide column names in the DataFrame. If the column name is not defined by default, it will take a value from 0 to n-1. </span></li></ul><h3><b><strong> Returns: </strong></b></h3><ul><li value="1"><span> DataFrame object </span></li></ul><p dir="ltr"><span> Now that we have discussed about DataFrame() function, let&#8217;s look at different ways to create a DataFrame: </span></p>
<h2 id="create-an-empty-dataframe-using-dataframe-method"><span> Create an Empty DataFrame using DataFrame() Method </span></h2><p dir="ltr"><span> Pandas Create Dataframe can be created by the DataFrame() function of the </span><a href="https://www.geeksforgeeks.org/introduction-to-pandas-in-python/" rel="noopener"><span> Pandas library </span></a><span> . Just call the function with the DataFrame constructor to create a DataFrame. </span></p><div id="_GFG_ABP_Incontent_728x90" style="text-align:center;"></div><div style="text-align:center;margin:20px 0;max-height: 280px;min-height:280px" id="GFG_AD_InContent_Desktop_728x280"></div>
<div id="internal-promo-section"><p dir="ltr"><span> Pandas DataFrames are essential for effective data handling and analysis in Python. Each method offers unique advantages depending on the data source and format.You can enroll in our </span><a href="https://gfgcdn.com/tu/Q3C/" rel="noopener" target="_blank"><b><strong> Complete Machine Learning &amp; Data Science Program </strong></b></a><b><strong></strong></b><span> to explore these techniques to leverage the full potential of Pandas for your data-centric tasks.Gain hands-on experience with Pandas DataFrames and learn advanced techniques </span><br></p>
</div><p dir="ltr"><b><strong>Example </strong></b><span> : Creating an empty DataFrame using the DataFrame() function in Python </span></p>
<gfg-tabs data-run-ide="true">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Importing Pandas to create DataFrame</span>
<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># Creating Empty DataFrame and Storing it in variable df</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>()</span>

<span class=c1># Printing Empty DataFrame</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p><div id="GFG_AD_Desktop_InContent_ATF_336x280" style="text-align:center; max-height: 280px;" data-lazy-loading="true"></div><div id="GFG_AD_gfg_mobile_336x280_1" style="margin: 5px 0;" data-lazy-loading="true"></div>
<pre><span>Empty DataFrame</span><br><span>Columns: []</span><br><span>Index: []</span></pre><h2 id="create-dataframe-from-lists-of-lists"><span>Create DataFrame from lists of lists </span></h2><p dir="ltr"><span>To create a Pandas DataFrame from a </span><a href="https://www.geeksforgeeks.org/python-lists/" rel="noopener"><span> list </span></a><span> of lists, you can use the pd.DataFrame() function. This function takes a list of lists as input and creates a DataFrame with the same number of rows and columns as the input list. </span></p>
<p dir="ltr"><b><strong> Example </strong></b><span> : Creating DataFrame from lists of lists using the DataFrame() method </span></p>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Import pandas library</span>
<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># initialize list of lists</span>
<span class=n>data</span> <span class=o>=</span> <span class=p>[[</span><span class=s1>&#39;tom&#39;</span><span class=p>,</span> <span class=mi>10</span><span class=p>],</span> <span class=p>[</span><span class=s1>&#39;nick&#39;</span><span class=p>,</span> <span class=mi>15</span><span class=p>],</span> <span class=p>[</span><span class=s1>&#39;juli&#39;</span><span class=p>,</span> <span class=mi>14</span><span class=p>]]</span>

<span class=c1># Create the pandas DataFrame</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>data</span><span class=p>,</span> <span class=n>columns</span><span class=o>=</span><span class=p>[</span><span class=s1>&#39;Name&#39;</span><span class=p>,</span> <span class=s1>&#39;Age&#39;</span><span class=p>])</span>

<span class=c1># print dataframe.</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span> Name  Age</span><br><span>0   tom   10</span><br><span>1  nick   15</span><br><span>2  juli   14</span></pre><h2 id="create-dataframe-from-dictionary-of-ndarraylists"><span> Create DataFrame from Dictionary of &nbsp;ndArray/Lists </span></h2><p dir="ltr"><span> To create DataFrame from a </span><a href="https://www.geeksforgeeks.org/python-dictionary/" rel="noopener"><span> dictionary </span></a><span> of </span><a href="https://www.geeksforgeeks.org/numpy-ndarray/" rel="noopener"><span> ndarrays </span></a><span> /lists, all the arrays must be of the same length. If an index is passed then the length index should be equal to the length of the arrays. </span></p>
<p dir="ltr"><span> If no index is passed, then by default, the index will be range(n) where n is the array length. </span></p>
<p dir="ltr"><b><strong> Example </strong></b><span> : Creating DataFrame from a dictionary of ndarray/lists </span></p><div style="text-align:center;margin:20px 0; max-height: 280px;" id="GFG_AD_gfg_outstream_incontent" data-lazy-loading="true"></div>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Python code demonstrate creating</span>
<span class=c1># DataFrame from dict narray / lists</span>
<span class=c1># By default addresses.</span>

<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># initialize data of lists.</span>
<span class=n>data</span> <span class=o>=</span> <span class=p>{</span><span class=s1>&#39;Name&#39;</span><span class=p>:</span> <span class=p>[</span><span class=s1>&#39;Tom&#39;</span><span class=p>,</span> <span class=s1>&#39;nick&#39;</span><span class=p>,</span> <span class=s1>&#39;krish&#39;</span><span class=p>,</span> <span class=s1>&#39;jack&#39;</span><span class=p>],</span>
        <span class=s1>&#39;Age&#39;</span><span class=p>:</span> <span class=p>[</span><span class=mi>20</span><span class=p>,</span> <span class=mi>21</span><span class=p>,</span> <span class=mi>19</span><span class=p>,</span> <span class=mi>18</span><span class=p>]}</span>

<span class=c1># Create DataFrame</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>data</span><span class=p>)</span>

<span class=c1># Print the output.</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span> Name  Age</span><br><span>0    Tom   20</span><br><span>1   nick   21</span><br><span>2  krish   19</span><br><span>3   jack   18</span></pre><p dir="ltr"><b><strong> Note: </strong></b><span> While creating DataFrame using a dictionary, the keys of the dictionary will be column names by default. We can also provide column names explicitly using column parameter. </span></p>
<h2 id="create-dataframe-from-list-of-dictionaries"><span> Create DataFrame from List of Dictionaries </span></h2><p dir="ltr"><span> Pandas DataFrame can be created by passing </span><a href="https://www.geeksforgeeks.org/how-to-create-list-of-dictionary-in-python/" rel="noopener"><span> lists of dictionaries </span></a><span> as input data. By default, dictionary keys will be taken as columns. </span></p>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Python code demonstrate how to create</span>
<span class=c1># Pandas DataFrame by lists of dicts.</span>
<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># Initialize data to lists.</span>
<span class=n>data</span> <span class=o>=</span> <span class=p>[{</span><span class=s1>&#39;a&#39;</span><span class=p>:</span> <span class=mi>1</span><span class=p>,</span> <span class=s1>&#39;b&#39;</span><span class=p>:</span> <span class=mi>2</span><span class=p>,</span> <span class=s1>&#39;c&#39;</span><span class=p>:</span> <span class=mi>3</span><span class=p>},</span>
        <span class=p>{</span><span class=s1>&#39;a&#39;</span><span class=p>:</span> <span class=mi>10</span><span class=p>,</span> <span class=s1>&#39;b&#39;</span><span class=p>:</span> <span class=mi>20</span><span class=p>,</span> <span class=s1>&#39;c&#39;</span><span class=p>:</span> <span class=mi>30</span><span class=p>}]</span>

<span class=c1># Creates DataFrame.</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>data</span><span class=p>)</span>

<span class=c1># Print the data</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span>a   b   c</span><br><span>0   1   2   3</span><br><span>1  10  20  30</span></pre><p dir="ltr"><span> Another example is to create a Pandas DataFrame by passing lists of dictionaries and </span><b><strong> row indexes </strong></b><span> . </span></p>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Python code demonstrate to create</span>
<span class=c1># Pandas DataFrame by passing lists of</span>
<span class=c1># Dictionaries and row indices.</span>
<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># Initialize data of lists</span>
<span class=n>data</span> <span class=o>=</span> <span class=p>[{</span><span class=s1>&#39;b&#39;</span><span class=p>:</span> <span class=mi>2</span><span class=p>,</span> <span class=s1>&#39;c&#39;</span><span class=p>:</span> <span class=mi>3</span><span class=p>},</span> <span class=p>{</span><span class=s1>&#39;a&#39;</span><span class=p>:</span> <span class=mi>10</span><span class=p>,</span> <span class=s1>&#39;b&#39;</span><span class=p>:</span> <span class=mi>20</span><span class=p>,</span> <span class=s1>&#39;c&#39;</span><span class=p>:</span> <span class=mi>30</span><span class=p>}]</span>

<span class=c1># Creates pandas DataFrame by passing</span>
<span class=c1># Lists of dictionaries and row index.</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>data</span><span class=p>,</span> <span class=n>index</span><span class=o>=</span><span class=p>[</span><span class=s1>&#39;first&#39;</span><span class=p>,</span> <span class=s1>&#39;second&#39;</span><span class=p>])</span>

<span class=c1># Print the data</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span>b   c     a</span><br><span>first    2   3   NaN</span><br><span>second  20  30  10.0</span></pre><h2 id="create-dataframe-from-a-dictionary-of-series"><span> Create DataFrame from a dictionary of Series </span></h2><p dir="ltr"><span> To create a dataframe in python from a dictionary of </span><a href="https://www.geeksforgeeks.org/python-pandas-series/" rel="noopener"><span> series </span></a><span> , a dictionary can be passed to form a DataFrame. The resultant index is the union of all the series of passed indexed. </span></p>
<p dir="ltr"><b><strong> Example: </strong></b><span> Creating a DataFrame from a dictionary of series. </span></p>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Python code demonstrate creating</span>
<span class=c1># Pandas Dataframe from Dicts of series.</span>

<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># Initialize data to Dicts of series.</span>
<span class=n>d</span> <span class=o>=</span> <span class=p>{</span><span class=s1>&#39;one&#39;</span><span class=p>:</span> <span class=n>pd</span><span class=o>.</span><span class=n>Series</span><span class=p>([</span><span class=mi>10</span><span class=p>,</span> <span class=mi>20</span><span class=p>,</span> <span class=mi>30</span><span class=p>,</span> <span class=mi>40</span><span class=p>],</span>
                      <span class=n>index</span><span class=o>=</span><span class=p>[</span><span class=s1>&#39;a&#39;</span><span class=p>,</span> <span class=s1>&#39;b&#39;</span><span class=p>,</span> <span class=s1>&#39;c&#39;</span><span class=p>,</span> <span class=s1>&#39;d&#39;</span><span class=p>]),</span>
     <span class=s1>&#39;two&#39;</span><span class=p>:</span> <span class=n>pd</span><span class=o>.</span><span class=n>Series</span><span class=p>([</span><span class=mi>10</span><span class=p>,</span> <span class=mi>20</span><span class=p>,</span> <span class=mi>30</span><span class=p>,</span> <span class=mi>40</span><span class=p>],</span>
                      <span class=n>index</span><span class=o>=</span><span class=p>[</span><span class=s1>&#39;a&#39;</span><span class=p>,</span> <span class=s1>&#39;b&#39;</span><span class=p>,</span> <span class=s1>&#39;c&#39;</span><span class=p>,</span> <span class=s1>&#39;d&#39;</span><span class=p>])}</span>

<span class=c1># creates Dataframe.</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>d</span><span class=p>)</span>

<span class=c1># print the data.</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span>   one  two</span><br><span>a   10   10</span><br><span>b   20   20</span><br><span>c   30   30</span><br><span>d   40   40</span></pre><h2 id="create-dataframe-using-the-zip-function"><span> Create DataFrame using the zip() function </span></h2><p dir="ltr"><span> Two lists can be merged by using the </span><a href="https://www.geeksforgeeks.org/zip-in-python/" rel="noopener"><span> zip() function </span></a><span> . Now, create the Pandas DataFrame by calling pd.DataFrame() function. </span></p><div style="text-align:center;margin:20px 0;max-height:280px" id="GFG_AD_gfg_outstream_incontent-1"></div>
<p dir="ltr"><b><strong> Example: </strong></b><span> Creating DataFrame using zip() function. </span></p>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Python program to demonstrate creating</span>
<span class=c1># pandas Dataframe from lists using zip.</span>

<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># List1</span>
<span class=n>Name</span> <span class=o>=</span> <span class=p>[</span><span class=s1>&#39;tom&#39;</span><span class=p>,</span> <span class=s1>&#39;krish&#39;</span><span class=p>,</span> <span class=s1>&#39;nick&#39;</span><span class=p>,</span> <span class=s1>&#39;juli&#39;</span><span class=p>]</span>

<span class=c1># List2</span>
<span class=n>Age</span> <span class=o>=</span> <span class=p>[</span><span class=mi>25</span><span class=p>,</span> <span class=mi>30</span><span class=p>,</span> <span class=mi>26</span><span class=p>,</span> <span class=mi>22</span><span class=p>]</span>

<span class=c1># get the list of tuples from two lists.</span>
<span class=c1># and merge them by using zip().</span>
<span class=n>list_of_tuples</span> <span class=o>=</span> <span class=nb>list</span><span class=p>(</span><span class=nb>zip</span><span class=p>(</span><span class=n>Name</span><span class=p>,</span> <span class=n>Age</span><span class=p>))</span>

<span class=c1># Assign data to tuples.</span>
<span class=n>list_of_tuples</span>


<span class=c1># Converting lists of tuples into</span>
<span class=c1># pandas Dataframe.</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>list_of_tuples</span><span class=p>,</span>
                  <span class=n>columns</span><span class=o>=</span><span class=p>[</span><span class=s1>&#39;Name&#39;</span><span class=p>,</span> <span class=s1>&#39;Age&#39;</span><span class=p>])</span>

<span class=c1># Print data.</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span> Name  Age</span><br><span>0    tom   25</span><br><span>1  krish   30</span><br><span>2   nick   26</span><br><span>3   juli   22</span></pre><h2 id="create-a-dataframe-by-proving-the-index-label-explicitly"><span> Create a DataFrame by proving the index label explicitly </span></h2><p dir="ltr"><span> To create a DataFrame by providing the index label explicitly, you can use the index parameter of the pd.DataFrame() constructor. The index parameter takes a list of index labels as input, and the DataFrame will use these labels for the rows of the DataFrame. </span></p>
<p dir="ltr"><b><strong> Example: </strong></b><span> Creating a DataFrame by proving the index label explicitly </span></p>
<gfg-tabs data-run-ide="false">
            <gfg-tab slot="tab">Python</gfg-tab>
<gfg-panel slot="panel" data-code-lang="python3">
    <code class="language-python3"><div class=highlight><pre><span></span><span class=c1># Python code demonstrate creating</span>
<span class=c1># pandas DataFrame with indexed by</span>

<span class=c1># DataFrame using arrays.</span>
<span class=kn>import</span> <span class=nn>pandas</span> <span class=k>as</span> <span class=nn>pd</span>

<span class=c1># initialize data of lists.</span>
<span class=n>data</span> <span class=o>=</span> <span class=p>{</span><span class=s1>&#39;Name&#39;</span><span class=p>:</span> <span class=p>[</span><span class=s1>&#39;Tom&#39;</span><span class=p>,</span> <span class=s1>&#39;Jack&#39;</span><span class=p>,</span> <span class=s1>&#39;nick&#39;</span><span class=p>,</span> <span class=s1>&#39;juli&#39;</span><span class=p>],</span>
        <span class=s1>&#39;marks&#39;</span><span class=p>:</span> <span class=p>[</span><span class=mi>99</span><span class=p>,</span> <span class=mi>98</span><span class=p>,</span> <span class=mi>95</span><span class=p>,</span> <span class=mi>90</span><span class=p>]}</span>

<span class=c1># Creates pandas DataFrame.</span>
<span class=n>df</span> <span class=o>=</span> <span class=n>pd</span><span class=o>.</span><span class=n>DataFrame</span><span class=p>(</span><span class=n>data</span><span class=p>,</span> <span class=n>index</span><span class=o>=</span><span class=p>[</span><span class=s1>&#39;rank1&#39;</span><span class=p>,</span>
                               <span class=s1>&#39;rank2&#39;</span><span class=p>,</span>
                               <span class=s1>&#39;rank3&#39;</span><span class=p>,</span>
                               <span class=s1>&#39;rank4&#39;</span><span class=p>])</span>

<span class=c1># print the data</span>
<span class=nb>print</span><span class=p>(</span><span class=n>df</span><span class=p>)</span>
</pre></div></code>
</gfg-panel></gfg-tabs><p dir="ltr"><b><strong> Output: </strong></b></p>
<pre><span> Name  marks</span><br><span>rank1   Tom     99</span><br><span>rank2  Jack     98</span><br><span>rank3  nick     95</span><br><span>rank4  juli     90</span></pre><h2 id="conclusion"><span> Conclusion </span></h2><p dir="ltr"><span> Python Pandas DataFrame is similar to a table with rows and columns. It is a two-dimensional data structure and is very useful for data analysis and data manipulation. </span></p>
<p dir="ltr"><span> In this tutorial, we have discussed multiple ways of creating a Pandas DataFrame. With this tutorial, you will be able to handle any complex requirement of creating DataFrame. </span></p>
<h2 id="different-ways-to-create-pandas-dataframe-faqs"><span> Different ways to create Pandas Dataframe &#8211; FAQs </span></h2><h3 id="what-are-the-methods-for-dataframe-in-python"><span> What are the methods for DataFrame in Python? </span></h3><blockquote><p dir="ltr"><span> Some common methods for pandas DataFrame include: </span></p>
<ul><li value="1"><b><code><strong> head() </strong></code></b><b><strong> : </strong></b><span> Returns the first n rows. </span></li><li value="2"><b><code><strong> tail() </strong></code></b><b><strong> : </strong></b><span> Returns the last n rows. </span></li><li value="3"><b><code><strong> info() </strong></code></b><b><strong> : </strong></b><span> Provides a summary of the DataFrame. </span></li><li value="4"><b><code><strong> describe() </strong></code></b><b><strong> : </strong></b><span> Generates descriptive statistics. </span></li><li value="5"><b><code><strong> sort_values() </strong></code></b><b><strong> : </strong></b><span> Sorts the DataFrame by specified columns. </span></li><li value="6"><b><code><strong> groupby() </strong></code></b><b><strong> : </strong></b><span> Groups the DataFrame using a mapper or by series of columns. </span></li><li value="7"><b><code><strong> merge() </strong></code></b><b><strong> : </strong></b><span> Merges DataFrame or named series objects with a database-style join. </span></li><li value="8"><b><code><strong> apply() </strong></code></b><b><strong> : </strong></b><span> Applies a function along the axis of the DataFrame. </span></li><li value="9"><b><code><strong> drop() </strong></code></b><b><strong> : </strong></b><span> Removes specified labels from rows or columns. </span></li><li value="10"><b><code><strong> pivot_table() </strong></code></b><b><strong> : </strong></b><span> Creates a pivot table. </span></li><li value="11"><b><code><strong> fillna() </strong></code></b><b><strong> : </strong></b><span> Fills NA/NaN values. </span></li><li value="12"><b><code><strong> isnull() </strong></code></b><b><strong> : </strong></b><span> Detects missing values. </span></li></ul></blockquote><h3 id="which-data-types-can-be-used-to-create-dataframe"><span> Which data types can be used to create DataFrame? </span></h3><blockquote><p dir="ltr"><span> DataFrames can be created using various data types including: </span></p>
<ul><li value="1"><span> Dictionaries of arrays, lists, or series. </span></li><li value="2"><span> Lists of dictionaries. </span></li><li value="3"><span> 2D NumPy arrays. </span></li><li value="4"><span> Series. </span></li><li value="5"><span> Another DataFrame </span></li></ul><pre><span>import pandas as pd</span><br><span>import numpy as np</span><br><span># From a dictionary of lists</span><br><span>df1 = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})</span><br><span># From a list of dictionaries</span><br><span>df2 = pd.DataFrame([{'A': 1, 'B': 4}, {'A': 2, 'B': 5}, {'A': 3, 'B': 6}])</span><br><span># From a 2D NumPy array</span><br><span>df3 = pd.DataFrame(np.array([[1, 4], [2, 5], [3, 6]]), columns=['A', 'B'])</span><br><span># From a series</span><br><span>df4 = pd.DataFrame({'A': pd.Series([1, 2, 3]), 'B': pd.Series([4, 5, 6])})</span></pre></blockquote><h3 id="how-many-data-types-are-there-in-a-pandas-dataframe"><span> How many data types are there in a pandas DataFrame? </span></h3><blockquote><p dir="ltr"><span> A pandas DataFrame can contain multiple data types across its columns, such as: </span></p>
<ul><li value="1"><b><code><strong> int64 </strong></code></b><b><strong> : </strong></b><span> Integer values. </span></li><li value="2"><b><code><strong> float64 </strong></code></b><b><strong> : </strong></b><span> Floating-point values. </span></li><li value="3"><b><code><strong> object </strong></code></b><b><strong> : </strong></b><span> Text or mixed types. </span></li><li value="4"><b><code><strong> datetime64[ns] </strong></code></b><b><strong> : </strong></b><span> Date and time values. </span></li><li value="5"><b><code><strong> bool </strong></code></b><b><strong> : </strong></b><span> Boolean values. </span></li></ul><p dir="ltr"><span> You can check the data types of a DataFrame using the </span><code><span> dtypes </span></code><span> attribute. </span></p>
<pre><span>df = pd.DataFrame({'A': [1, 2, 3], 'B': [4.0, 5.1, 6.2], 'C': ['x', 'y', 'z']})</span><br><span>print(df.dtypes)</span><br><span>#</span><b><strong> Output:</strong></b><br><span># A      int64</span><br><span># B    float64</span><br><span># C     object</span><br><span># dtype: object</span></pre></blockquote><h3 id="why-use-dataframe-instead-of-a-dataset"><span> Why use DataFrame instead of a dataset? </span></h3><blockquote><p dir="ltr"><span> DataFrames are specifically designed for data manipulation and analysis, offering several advantages over general datasets: </span></p>
<ul><li value="1"><span> Integrated handling of missing data. </span></li><li value="2"><span> Label-based indexing for rows and columns. </span></li><li value="3"><span> Powerful data alignment and broadcasting. </span></li><li value="4"><span> Extensive functionality for data manipulation, aggregation, and transformation. </span></li><li value="5"><span> Better performance for operations involving structured data. </span></li><li value="6"><span> Integration with a variety of data sources and file formats. </span></li></ul></blockquote><h3 id="what-type-is-a-dataframe-in-pandas"><span> What type is a DataFrame in pandas? </span></h3><blockquote><p dir="ltr"><span> In pandas, a DataFrame is of the type pandas.core.frame.DataFrame. </span></p>
<pre><span>import pandas as pd</span><br><br><span>df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})</span><br><span>print(type(df))  # Output: &lt;class 'pandas.core.frame.DataFrame'&gt;</span></pre></blockquote><br/><div id="AP_G4GR_6"></div>

                                    <div class='article_bottom_text'></div><br>
                                                                          <div id="video-tab-content" class="video-tab-content">
                                        
<script>
  let API_SCRIPT_URL = "https://apiscript.geeksforgeeks.org/"
  let GFG_SITE_URL = "https://www.geeksforgeeks.org/"
  const updateUserViewurl = `${API_SCRIPT_URL}update-user-views/`;
  const getCsrfTokenUrl = `${API_SCRIPT_URL}get-csrf-token/`;
  var main_video_description_details = "";
  //html to text
  function htmlToText(html) {
    var temp = document.createElement('div');
    temp.innerHTML = html;
    return temp.textContent;
  }

  //add utm param into the url

  function addVideoTabParam(url){
      var url = new URL(url);

      url.searchParams.append('utm_source', 'geeksforgeeks');
      url.searchParams.append('utm_medium', 'article_video_tab');
      url.searchParams.append('utm_campaign', 'article_video_tab');

      return url.href;
  }

  //function to get term name
  function getTermType(type){
      if(type === 1) return "category";
      return "tag";
  }

  //function fit related videos description into at most two line if description if large
  function fitRelatedVideosDescription(){
    var elements = document.getElementById("related-videos-content").querySelectorAll(".flex-grid-row .description-main .video-description");
    elements.forEach((element)=>{
      // console.log(element.offsetHeight, element.innerHTML);
      element.classList.remove("display2lines");
      element.querySelector('.read-more-btn').style.display = 'none';
      if(element.offsetHeight > 50){
        element.classList.add("display2lines");
        element.querySelector('.read-more-btn').style.display = 'block';
      }
    });
  }

  //formating the date into [DD m, YYYY] format
  function formatDate(year, month ,day){
    month-=1;
    let d = new Date(year, month, day);
    d = d.toString();
    let date_sep = d.split(" ");
    return date_sep[2] + " " + date_sep[1] + ", " + date_sep[3];
  }

  //To get cookie value saved into the browser cookie
  function getCookie(name) {
      let cookieValue = null;
      let cooks = document.cookie.split(";");

      for (var i = 0; i < cooks.length; i++) {
          var icook = cooks[i].split("=");
          if (icook[0].trim() === name) {
              cookieValue = icook[1].trim();
          }
      }

      return cookieValue;
  }

  function onWidthChangeEventsListener(){
    fitRelatedVideosDescription();
  }
</script>
<style>
/* Article page videos tab css start */
.like-icon-span {
  cursor: pointer;
}
.save-icon-span {
  cursor: pointer;
}

.display2lines {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.flex-grid-row {
  display: flex;
}

.flex-grid-row .md-col-8-sm-col-6 {
  width: 66.66%;
}

.flex-grid-row .md-col-4-sm-col-6 {
  width: 33.33%;
}

.videos-content{
  margin-top: 0px;
  line-height: 1.5;
}

.videos-content .video-poster{
  width: 100%;
  height: 170px !important;
  border-radius: 6px;
  cursor: pointer !important;
}
.videos-content .video-content{
  margin: 0 0 0 25px;
}

.videos-content .title {
  margin-top: 0px;
  color: var(--color-black);
  font-size: 18px !important;
  font-weight: 700 !important;
  font: var(--font-primary);
  line-height: 1.5 !important;

  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

}
.videos-content  .description-main{
  margin: 1rem 0;
}
.videos-content  .video-description{
  font: var(--font-primary);
  font-size: 16px !important;
  width: auto;
  color: var(--gfg-text-color);
  position: relative;
  line-height: 1.5;
}

.videos-content  .video-description p{
  font: var(--font-primary) !important;
  color: var(--gfg-text-color) !important;
}

.videos-content  .video-description p strong{
  color: var(--gfg-text-color) !important;
}

.video-content .video-description p{
  text-align: left !important;
}
.read-more-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    background: var(--gfg-body-color);
    color: var(--color-gfg);
    display: none;
}

.videos-content  .read-more-span{
  color: var(--color-gfg);
  cursor: pointer;
}

.videos-content  .read-less-span{
  color: var(--color-gfg);
  cursor: pointer;
}

.videos-content  .explore-video-btn {
  background-color: var(--color-gfg);
  padding: 5px 16px;
  border-radius: 6px;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  margin-top: 15px
}

.videos-content  .explore-video-btn:hover{
  transition: 0.4s;
  -webkit-box-shadow: 2px 0px 4px 0px rgba(0,0,0,0.75);
  -moz-box-shadow: 2px 0px 4px 0px rgba(0,0,0,0.75);
  box-shadow: 2px 0px 4px 0px rgba(0,0,0,0.75);
}

.videos-content  .video-content{
  height: 100%;
  /* display: flex;
  align-items: center; */
}
.videos-content  .videos-horizontal-line{
  border: 0;
  height: 1px;
  background: var(--gfg-darkgrey);
  margin: 30px 0px !important;
}
.videos-content  .videos-view-all-btn {
  font-family: var(--font-primary);
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 26px;
  /* text-decoration-line: underline; */
  color: var(--gfg-color-lg);
  cursor: pointer;
}
.videos-content  .videos-view-all-btn:hover{
  color: var(--color-gfg);
}
.btn-main{
  margin-top: 15px;
}


/* Article page videos tab css end */


/* Article page video-tab css start*/
#article-video {
  height:360px;
  width: 640px;
}
.related-videos-main{
  position: relative;
  margin: -6px 0 16px 0;
}
.related-videos-main .heading {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-black);
}
.video-view-all-main{
    /* position: absolute; */
    float: right;
    right: 5px;
    bottom: 0px;
}
.article-video-tab-content {
  margin: 27px 0 0 0;
  font-family: var(--font-primary);
}
.video-share-section{
  display: flex;
  margin: 16px 0 0 0;
}

.video-share-section .date-main{
  width: 50%;
}

.share-icons-main{
  width: 50%;
  display: flex; 
  flex-direction: row-reverse;
}
.share-icons-main .icon-div {
  position: relative;
}

.share-icons-main span{
  font-size: 16px;
}

.share-icons-main i{
  cursor: pointer;
}

.date-main span{
  font-size: 16px;
  color: var(--color-black);
}
.article-video-tab-content  .videos-horizontal-line{
  border: 0;
  height: 1px;
  background: var(--gfg-darkgrey);
  margin: 15px 0px;
}

/* .article-video-tab-content .videos-horizontal-line{
  border: 1px solid #D6D5D5;
  margin: 14px 0px;
} */

.video-content-section .video-title{
  margin: 20px 0 10px 0;
  color: var(--color-black);
  font-size: 20px !important;
  font-weight: 700 !important;
  font: var(--font-primary);
  line-height: 1.5 !important;

  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-video-tab-content  .read-more-span{
  color: var(--color-gfg) !important;
  cursor: pointer;
}

.article-video-tab-content  .read-less-span{
  color: var(--color-gfg) !important;
  cursor: pointer;
}

.video-content-section .video-description {
  font-size: 16px;
  color: var(--gfg-text-color);
}

.article-video-tab-content .video-tags-list {
  margin: 15px 0 0 0;
}

.article-video-tab-content .video-tags-list .item{
  color: var(--color-gfg);
  font-size: 14px !important;
  padding: 0 13px 0 0;
  display: inline-block;
  cursor: pointer;
}

.explore-all-btn-main{
    margin: 5px 0 80px 0;
}

.explore-all-btn {
  float:right;
  font-size: 16px;
  color: var(--navy-blue-to-grey);
  cursor: pointer;

  display: flex;
  position: relative;
  width: 115px;

}

.share-icons-main .like-icon{
  width:70px;
}
/* .share-icons-main .like-icon i{
  position: absolute;
  left: 32px;
} */
/* Article page video-tab css end*/


@media (max-width: 1440px) {
  .flex-grid-row .md-col-8-sm-col-6{
      width: 60%;
  }
  
  .flex-grid-row .md-col-4-sm-col-6{
      width: 40%;
  }
}

@media (max-width: 1300px) {

  .videos-content .video-poster{
    height: 155px !important;
  }

  .flex-grid-row .md-col-8-sm-col-6{
      width: 55%;
  }
  
  .flex-grid-row .md-col-4-sm-col-6{
      width: 45%;
  }

}

@media (max-width: 1024px) {
  .flex-grid-row .md-col-8-sm-col-6{
      width: 50%;
  }
  
  .flex-grid-row .md-col-4-sm-col-6{
      width: 50%;
  }

  .btn-main{
    margin-top: 10px;
  }
  .videos-content .explore-video-btn{
    padding: 3px 10px;
  }
}

@media (max-width: 992.5px) {
  .flex-grid-row .md-col-8-sm-col-6{
      width: 66%;
  }
  
  .flex-grid-row .md-col-4-sm-col-6{
      width: 34%;
  }

  .videos-content .video-poster{
    height: 145px !important;
  }

  .videos-content .title {
    font-size: 16px !important;
    font-weight: 700 !important;
    font: var(--font-primary);
  }
  .videos-content .description-main {
      margin: 10px 0;
  }
  .videos-content .description-main p{
    line-height: 1.3 !important;
  }
  .read-more-btn{
    line-height: 1.2 !important;
  }
}

@media (max-width: 768px) {
  .flex-grid-row .md-col-8-sm-col-6{
      width: 50%;
  }

  .flex-grid-row .md-col-4-sm-col-6{
      width: 50%;
  }

  #article-video {
    max-height:300px;
    min-height: 300px;
    width: 100%;
  }

}

@media(max-width:500px) {

  .videos-content .video-poster{
    height: 115px !important;
  }

  .videos-content  .description-main{
      margin: 5px 0;
      line-height: 1.2 !important;
  }
  .videos-content  .video-description {
      font-size: 13px !important;
  }

  .videos-content .video-content {
    margin: 0 0 0 7px;
  }

  .videos-content  .videos-horizontal-line{
      margin: 20px 0px;
  }

  #article-video {
    max-height:200px;
    min-height: 200px;
    width: 100%;
  }

  .article-video-tab-content .video-tags-list .item{
    font-size: 12px !important;
    padding: 0 7px 0 0;
  }

  .article-video-tab-content .video-tags-list {
    margin: 0px 0 0 0;
  }
  .video-content-section .video-title {
    margin: 0px 0 0px 0;
    font-size: 18px !important;
  }
  .explore-all-btn {
    font-size: 14px;
    width: 105px;
  }


  .videos-content .videos-view-all-btn {
    font-size: 14px;
  }
  .explore-all-btn-main {
    margin: 5px 0 55px 0;
  }

  .related-videos-main .heading {
    font-size: 22px;
  }

  .videos-content .video-description {
    display: none;
  }
  .flex-grid-row {
    border-radius: 6px;
    padding: 0 0 13px 0;
    margin-bottom: 15px;
    display: block;
    border: 1px solid rgba(190, 186, 186, 0.08);
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25);
    background: var(--white-to-lightblack2);
  }
  .flex-grid-row .md-col-4-sm-col-6 {
    width: 100%;
  }
  .flex-grid-row .md-col-8-sm-col-6 {
    width: 100%;
  }
  .videos-content .video-poster {
    height: 180px !important;
  }
  .videos-content  .title{
    font-size: 16px !important;
    margin: 5px 0px 15px 0px;
    line-height: 1.5 !important;
  }
  .videos-content .explore-video-btn {
    padding: 6px 9px;
    font-size: 11px;
  }
  .videos-content .videos-horizontal-line {
    display: none;
  }
  .btn-main {
    margin: 10px 0 0 0px;
  }
  .related-videos-main {
    margin: 10px 0 15px 0;
  }
  .video-share-section {
    margin: 8px 0 0 0;
  }
  .article-video-tab-content .videos-horizontal-line {
    margin: 5px 0px;
  }
  .share-icons-main span {
    font-size: 13px;
  }
  .date-main span {
    font-size: 14px;
  }
  .share-icons-main .icon-div {
    position: relative;
  }
  /* .share-icons-main .like-icon i {
    top: -4px;
    left: 26px;
  } */
  .share-icons-main .like-icon {
    width: 60px;
  }

  .video-content-section .video-description {
    font-size: 14px;
  }
  .article-video-tab-content {
    margin: 16px 0 0 0;
  }
}

@media(max-width:400px) {
  .videos-content  .title{
      font-size: 13px !important;
      margin-bottom: 0px;
  }

  .videos-content  .video-description {
      font-size: 12px !important;
  }

  .videos-content  .videos-horizontal-line{
      margin: 15px 0px;
  }
  .videos-content .title {
    line-height: 1.4 !important;
  }
}

@media(max-width:325px) {
  .videos-content  .description-main{
      margin: 1px 0;
  }
  .videos-content  .videos-horizontal-line{
      margin: 10px 0px;
  }
}

.video-content-section table tbody tr td {
  padding: 0px !important;
  border: none !important;
}

.videos-content table tbody tr td {
  padding: 0px !important;
  border: none !important;
}

.videos-content table tbody tr {
  background-color: inherit !important;
}

.video-content-section table {
  margin: 0px !important;
  border: none !important;
  width: unset !important;
  line-height: 1.2 !important;
  border-collapse: inherit !important;
  border-spacing: 2px !important;
}

.videos-content table {
  margin: 0px !important;
  border: none !important;
  width: unset !important;
  line-height: 1.2 !important;
  border-collapse: inherit !important;
  border-spacing: 2px !important;
}

.video-tab-content .gfg-icon_thumbs::after {
      background-position: -40px -1644px;
}

.gfg-icon_thumb_filled::after {
  background-position: -40px -1604px;
}

.gfg-icon_bookmark_filled::after {
    background-position: -40px -962px;
}

.gfg-icon_tag-secondary::after{
  background-position: -125px -400px;
}

.video-tab-content .gfg-icon_tag-primary:after{
  background-position: -6px -400px !important;
}

.poster-div{
  position: relative;
}

.poster-div .video-time{
  position: absolute;
  bottom: 10px;
  right: 7px;
  border-radius: 11px;
  background: rgba(0,0,0,.65);
  padding: 0 12px 2px 12px;
  color: white;
  font-size: 13px;
}
.poster-div img{
  margin:unset !important;
}
.video-content .read-more-btn span {
    color: var(--gfg-text-color);
}

.article-video-tab-content .video-description :is(h1, h2, h3, h4, h5, h6){
  color: var(--color-black) !important;
}

.article-video-tab-content .video-description :is(h1, h2, h3, h4, h5, h6) span{
  color: var(--color-black) !important;
}

.article-video-tab-content .video-description :is(h1, h2, h3, h4, h5, h6) p{
  color: var(--color-black) !important;
}

.article-video-tab-content .video-description span{
  color: var(--gfg-text-color) !important;
}

.article-video-tab-content .video-description p{
  color: var(--gfg-text-color) !important;
}

.article-video-tab-content .video-description a{
  color: var(--color-gfg) !important;
}
.article-video-tab-content .video-description a span{
  color: var(--color-gfg) !important;
}

.disable_btn_click{
  pointer-events:none;
  opacity: 0.5;
}

.video-main{
  display:flex;
  justify-content:center;
}

.vjs-menu-content li{
  margin:0px !important;
  text-align:center !important;
  color:white !important;
}
.vjs-menu li.vjs-selected{
  color:black !important;
}
</style>

<script>
  //adding video min css file into head
  var video_js_css = document. createElement("link");
  video_js_css. rel = "stylesheet";
  video_js_css. href = `${GFG_SITE_URL}videojs/videoapp.min.css`;
  $("head"). append(video_js_css);

  //creating config object for requiring videojs related files
  require.config({
      paths: {
          "videojs":`${GFG_SITE_URL}videojs/video.min`,
          'ima': `${GFG_SITE_URL}videojs/video.ima.min`,
          'quality_levels' : `${GFG_SITE_URL}videojs/videojs_contrib_quality_levels.min`,
          'quality_selector': `${GFG_SITE_URL}videojs/videojs_hls_quality_selector.min`
      },
      shim:{
          'ima': {
              deps: ['videojs', 'quality_levels', 'quality_selector']
          },
          'quality_levels': {
              deps: ['videojs-in-global']
          }
      }
  });

  
  define('global/window', [], () => {
      return window;
  });
  
  define('global/document', ['global/window'], (window) => {
      return window.document;
  });
  
  define("video.js",["videojs"], function(videojs) {
      return window.videojs;
  });
  
  define("videojs-in-global",["videojs"], function(videojs) {
      window.videojs = videojs;
  });
</script>

<!-- main rendering html -->
<div class="article-video-tab-content" id="article-video-tab-content" style="display: none;">

<!-- main video html --> 
  <div class="main-video-container" id="main-video-container">
    <div class="video-main"></div>
    <div class="video-share-section"></div>
    <!-- <hr/> -->
    <div class="video-content-section"></div>
    <div class="videos-horizontal-line"></div>
    <!-- <hr/> -->
  </div>

  <!-- This section needs to be removed -->
  <!-- related videos section -->
  </div>


<script>
  //this variable is to check video is played first time or not
  let firstTimePlay=false;
  //functio to 2 digits number string
  function to2Digits(n){
    n = n.toString();
    if(n.length == 0) return "00";
    if(n.length == 1) return "0"+n;
    return n;
  }

  //function to convert sencons to H:M:S string
  function secondsToHms(time) {
    time = Number(time);
    let h = Math.floor(time / 3600);
    let m = Math.floor(time % 3600 / 60);
    let s = Math.floor(time % 3600 % 60);

    if(h){
      h = to2Digits(h);
    }
    
    m = to2Digits(m);
    s = to2Digits(s);

    return h ? (h +":"+ m +":"+ s) :  (m +":"+ s); 
  }

  //On play video this will get called
  function videoPlayCallback(slug){
    if(!firstTimePlay){

        //retrieving csrftoken from cookie
        var csrf = getCookie("csrftoken");
        //Creating request params
        let data = {
            method:'POST',
            credentials: "include",
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
                'x-csrftoken': csrf,
            },
            body:JSON.stringify({
                "slug":slug
            }),
        };

        if(!!!csrf) //if csrf token is not present then first we will set csrf token then triggering api
        {
            fetch(getCsrfTokenUrl, {
                credentials: "include"
            }).then(res=>{
                csrf = getCookie("csrftoken");
                data.headers['x-csrftoken'] = csrf;
                fetch(updateUserViewurl,data).then(res=>res.json()).then(res=>{
                    console.log(res)
                    firstTimePlay=true;
                }).catch((err)=>{
                    console.log("error: ", err);
                });
            }).catch((err)=>{
              console.log(err);
            });;
        }
        else { //csrf token is already present into cookie so call api directly
            fetch(updateUserViewurl,data).then(res=>res.json()).then(res=>{
                console.log(res)
                firstTimePlay=true;
            }).catch((err)=>{
                console.log("error: ", err);
            });
        }

    }
  }


  //function to return shorted text
  function ellipsisText(text, length){

    text = htmlToText(text);

    if(text.length<=length){
        return false;
    };
    return text.substring(0, length);
  }

  //function to hide extre text of the description if it is large
  function hideMainVideoDescription(video_description, video_id) {
      let width = $( window ).width();

      let text_length =  Math.floor(120*width/1440);
      let text = ellipsisText(video_description, text_length);
      if(text){
          text += `... <span class='read-more-span' onClick='readMore(${video_id})' style="color: var(--color-gfg) !important;">Read More</span>`;
      } else {
          text = video_description;
      }
      return text;
  }


  //function to hide the related videos description
  function showLessRelatedVideoDes(description){
    return description;
    let width = $( window ).width();
    let denominator = 1600;
    if(width>992 && width<=1300) {
        denominator = 2100;
    }
    let text_length =  Math.floor(90*width/denominator);

    let text = ellipsisText(description, text_length);
    if(text){
        text += `... <span class='read-more-span'>Read More</span>`;
    } else {
        text = description;
    }

    return text;
  }

  //function to set like icon's text and color
  function setLiked(val) {
    $(document).ready(function(){
      if(val == true){
        $('#video-like-btn').removeClass("gfg-icon_thumbs");
        $('#video-like-btn').addClass("gfg-icon_thumb_filled");
        $('#like-icon-span').html("Liked");

      } else {
        $('#video-like-btn').removeClass("gfg-icon_thumb_filled");
        $('#video-like-btn').addClass("gfg-icon_thumbs");
        $('#like-icon-span').html("Like");
      }
    });
    document.getElementById('video-like-btn').setAttribute('data-like-status', val);
  }

  //function to set save icon's text and color
  function setSaved(val) {
    $(document).ready(function(){
      if(val == true){
        $('#video-save-btn').addClass("gfg-icon_bookmark_filled");
        $('#save-icon-span').html("Saved");
      } else {
        $('#video-save-btn').removeClass("gfg-icon_bookmark_filled");
        $('#save-icon-span').html("Save");
      }
    });
    document.getElementById('video-save-btn').setAttribute('data-save-status', val);
  }

  //function to call like api to upadte like status
  async function likeVideo(videoId, slug){
    if(!loginData || !loginData.isLoggedIn){
      document.getElementsByClassName("login-modal-btn")[0].click();
      return;
    }
    document.getElementById(`video-like-btn`).classList.add("disable_btn_click");
    document.getElementById(`like-icon-span`).classList.add("disable_btn_click");

    let liked = (document.getElementById(`video-like-btn`).getAttribute('data-like-status')==='true');
    let watchlist = (document.getElementById(`video-save-btn`).getAttribute('data-save-status')==='true');

    var csrf = getCookie("csrftoken");

    if(!!!csrf) //if csrf token is present then set csrf token first then call save api
    {
      await fetch(getCsrfTokenUrl, {
          credentials: "include"
      });
    }

    let payload = {
      id: videoId,
      liked,
      viewed: true,
      watchlist,
      slug
    };

    try {
        let resp = await fetch(`${API_SCRIPT_URL}update-user-likes/`, {
          method: 'POST',
          credentials: 'include',
          headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json',
              "X-CSRFToken": getCookie("csrftoken")
          },
          body: JSON.stringify(payload)
        });
        if(resp.status >= 400)   return;
        setLiked(!liked);
        document.getElementById(`video-like-btn`).classList.remove("disable_btn_click");
        document.getElementById(`like-icon-span`).classList.remove("disable_btn_click");
    } catch(err) {
        document.getElementById(`video-like-btn`).classList.remove("disable_btn_click");
        document.getElementById(`like-icon-span`).classList.remove("disable_btn_click");

        console.log('error in getting stats of video for user', err);
    }
  }

  //function to call save api to upadte save status
  async function saveVideo(videoId, slug){
    if(!loginData || !loginData.isLoggedIn){
      document.getElementsByClassName("login-modal-btn")[0].click();
      return;
    }

    document.getElementById(`video-save-btn`).classList.add("disable_btn_click");
    document.getElementById(`save-icon-span`).classList.add("disable_btn_click");

    let liked = (document.getElementById(`video-like-btn`).getAttribute('data-like-status')==='true');
    let watchlist = (document.getElementById(`video-save-btn`).getAttribute('data-save-status')==='true');
    let payload = {
      id: videoId,
      liked,
      viewed: true,
      watchlist,
      slug
    };

    var csrf = getCookie("csrftoken");

    if(!!!csrf) //if csrf token is present then set csrf token first then call save api
    {
      await fetch(getCsrfTokenUrl, {
          credentials: "include"
      });
    }

    try {
        let resp =  await fetch(`${API_SCRIPT_URL}add-to-watchlist/`, {
          method: 'POST',
          credentials: 'include',
          headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json',
              "X-CSRFToken": getCookie("csrftoken")
          },
          body: JSON.stringify(payload)
        });
        if(resp.status >= 400)   return;
        setSaved(!watchlist);
        document.getElementById(`video-save-btn`).classList.remove("disable_btn_click");
        document.getElementById(`save-icon-span`).classList.remove("disable_btn_click");
    } catch(err) {
        document.getElementById(`video-save-btn`).classList.remove("disable_btn_click");
        document.getElementById(`save-icon-span`).classList.remove("disable_btn_click");
        console.log('error in getting stats of video for user', err);
    }
  }

  //when anybody click on readless btn this function will get called and will hide the extra text
  function readLess(id){
    let width = $( window ).width();
    let text_length =  Math.floor(120*width/1440);
    let text = ellipsisText(main_video_description_details, text_length);
    if(text){
        text += `... <span class='read-more-span' onClick='readMore(${id})' style="color: var(--color-gfg) !important;">Read More</span>`;
    } else {
        text = video_description;
    }
    document.getElementById(`video_id-${id}`).innerHTML = text;
  }

  //when anybody click on readMore btn this function will get called and will show the full description
  function readMore(id){
    document.getElementById(`video_id-${id}`).innerHTML = main_video_description_details + ` <span class='read-less-span' onClick='readLess(${id})' style="color: var(--color-gfg) !important;">Read Less</span>`;
  }


</script>

<script>
    $(document).ready(function(){
      var curr_post_id = post_id;
      // curr_post_id = 3622;
      $(document).on('click', '.dark-editor-button', function () {
        $('.article-video-tab-content  .videos-horizontal-line:first').css("opacity", "0.2");
      });

      $(document).on('click', '.light-editor-button', function () {
        $('.article-video-tab-content  .videos-horizontal-line:first').css("opacity", "0.5");
      });

      if(window.localStorage.getItem('codeEditorTheme')=="monokai"){
        $('.article-video-tab-content  .videos-horizontal-line:first').css("opacity", "0.2");
      } else {
        $('.article-video-tab-content  .videos-horizontal-line:first').css("opacity", "0.5");
      }
      

      // this fucntion will fit whole html of the video's content
      async function getVideoData(){
        try {
          var post_data = "";
          var video_data ;
          var course_link = "";
          var videos = [];
          var video_description = "";
          var video_id = null;
          // if(!!post_data && post_data.length>0){
            if(true){
            /*var course_link = "";
            post_data[0]['course_link']?post_data[0]['course_link']:"";*/
            video_data = video_api_response;
            video_description = video_data['description'];
            main_video_description_details = video_data['description'];
            video_id = video_data['id'];
            // videos = video_data['recommendations'];
          } else{
            $('#main-video-container').remove();
            let videoPageVideos = await((await fetch(`${API_SCRIPT_URL}gfg-video-list/`)).json());
            if(videoPageVideos && videoPageVideos.results){
              videos = videoPageVideos.results
            }
            if(!!videos && videos.length>0){
                //Load related videos
                vidoes = videos.map((video)=>{
                  video.thumbnail = video && video.meta ? video.meta.thumbnail : undefined;

                  video.largeThumbnail = video && video.meta ? video.meta.largeThumbnail : undefined;

                  return video;
                })
                $(".related-videos-content").html(getvideosContent(10));
            }
            // element = document.getElementById('article-video-tab-content');
            // element.style.display = 'block';
            $('.spinner-loading-overlay:eq(0)').remove();
            $('.spinner-loading-overlay:eq(0)').remove();

            //this function will set related videos description
            fitRelatedVideosDescription();

            $(window).resize(function(){
              onWidthChangeEventsListener();
            });

            $('#video_nav_tab').click('on', function(){
              fitRelatedVideosDescription();
            });
            return;
          }
          
          /*if(!videos || videos.length==0){
            $('.videos-content').hide();
            // return;
          }*/

          //fucntion to get tags div content
          function getTagsString(tags){
            if(tags.length<=0){
              return "";
            }

            //here creatng the tags content div
            let tagContent = `
            <div class="video-tags-list">
                <table>
                  <tr>
                    <td>
                        <div >
                          <i class="gfg-icon gfg-icon_tag-primary"></i>
                        </div>
                    </td>
                    <td>
                    `;
            tags.map((tag)=>{
              let tag_url = `videos/${getTermType(tag['term_id__term_type'])}/${tag['term_id__slug']}/`;
              tagContent+=`<a href="${tag_url}"><div class='item'>`+ tag['term_id__term_name'] +`</div></a>`;
            });
            tagContent+=`</td>
                  </tr>
                </table>
              </div>`;
            return tagContent;
          }

          //function to create related videos cards
          function articlePagevideoCard(poster_src="", title="", description="", video_link, index, tags=[], duration=0){

            let card =  `<div class='flex-grid-row'>
                <div class='md-col-4-sm-col-6'>
                    <div class='poster-div'>
                      <div class="video-time">
                        ${secondsToHms(duration)}
                      </div>
                    <a href='${video_link}' style='text-decoration: none;'><img class='video-poster' src='${poster_src}' style='cursor:pointer !important;'>
                    </a>
                    </div>
                </div>
                <div class='md-col-8-sm-col-6' class='video-left-bar'>
                    <div class='video-content'>
                        <div>
                            <div class='title-main'>
                              <a href='${video_link}' style='text-decoration: none;'>  
                                <div class='title'>
                                  ${title}
                                </div> 
                              </a>
                            </div>
                            <a href='${video_link}' style='text-decoration: none;'>  
                            <div class='description-main'>
                                <div class='video-description display2lines' id='video_id-${index}'>
                                  ${showLessRelatedVideoDes(htmlToText(description))}
                                  <div class="read-more-btn"><span>... </span>Read More</div>
                                </div>
                            </div>
                            </a>
                          <div>
                            ${getTagsString(tags)}
                          </div>
                        </div>
                    </div>
                </div>
            </div>`;
            return card;
          }

          //function to set related videos content
          function getvideosContent(limit=3){
            videos_content = "";
            var total_videos = Math.min(videos.length, limit);
            for(let i=0;i<total_videos;i++){
                if(i < total_videos)
                {
                    videos_content+= articlePagevideoCard(videos[i]['largeThumbnail'],videos[i]['title'],videos[i]['description'],`${GFG_SITE_URL}`+'videos/'+videos[i]['slug']+'/', i, videos[i]['category'], videos[i]['duration']);
                    if(i != total_videos-1){
                      videos_content+= '<div class="videos-horizontal-line"></div>';
                    } else{
                      let view_all_url = `${GFG_SITE_URL}videos/`;
                      
                      videos_content+=`
                      <div class="video-view-all-main">
                          <a style="text-decoration:none;" href="${view_all_url}">
                              <span class="videos-view-all-btn">View All</span>
                          </a>
                      </div>
                      `;
                    }
                    // videos_content+= '<hr/>';
                }
            }
            return videos_content;
          }

          //function to show main video content with related videos content
          async function showMainVideoContent(main_video, course_link){
           
            //Load main video
            $(".video-main").html(`
                <video id="article-video" class="video-js vjs-default-skin vjs-big-play-centered"></video>
            `);

            require(["ima"], function() {

            var player = videojs('article-video', {
                  controls: true,
                  // autoplay: true,
                  // muted: true,
                  controlBar: {
                    pictureInPictureToggle: false
                  },
                  playbackRates: [0.5, 0.75, 1, 1.25, 1.5, 2],
                  poster: main_video['meta']['largeThumbnail'],
                  sources: [{src: main_video['source'], type: 'application/x-mpegURL'}],
                  tracks: [{src: main_video['subtitle'], kind:'captions', srclang: 'en', label: 'English', default: true}]
                },function() {
                  player.qualityLevels();
                  try {
                    player.hlsQualitySelector();  
                  } catch (error) {
                    console.log("HLS not working - ")
                  }  
                  document.getElementById('article-video-tab-content').style.display = 'block';
                }
              );

              const video = document.querySelector("video");
              const events =[
                  {
                      'name':'play',
                      'callback':()=>{videoPlayCallback(main_video['slug'])}
                  },
              ];
              events.forEach(event=>{
                video.addEventListener(event.name,event.callback);
              });

              // error handling for no compatible source
              player.on('error', function() {
                var error = player.error();
                console.log("Video Error: ", error);
                if (error && error.code === 4) {
                  console.log("No compatible source was found for this media.");
                  hideVideoPlayer();
                }
              });
            
            }, function(err) {
              var player = videojs('article-video');
              player.createModal('Something went wrong. Please refresh the page to load the video.');
              hideVideoPlayer(); // hiding video in case of timeout (requirejs)
              console.log(err);
            });
            
            // function to hide the video player
            function hideVideoPlayer() {
              var videoPlayer = document.getElementById('article-video');
              if (videoPlayer) {
                videoPlayer.parentNode.removeChild(videoPlayer);
              }
            }

            /*let video_date = main_video['time'];
            video_date = video_date.split("/");
            video_date = formatDate(video_date[2], video_date[1], video_date[0]);

            let share_section_content = `<div class="date-main">
                <span>${video_date}</span>
            </div>`;*/

            let hasLikeBtn = false;

            // console.log(share_section_content);
            var data = {};

            if(false){
              try {
                if((loginData && loginData.isLoggedIn == true)){
                    const resp = await fetch(`${API_SCRIPT_URL}logged-in-video-details/${main_video['slug']}/`,{
                    credentials: 'include'
                    })
                    if(resp.status == 200 || resp.status == 201){
                        data = await resp.json();
                        share_section_content+= `<div class="share-icons-main">
                            <div class="icon-div save-icon"><span class="save-icon-span" id="save-icon-span" onClick="saveVideo(${main_video['id']}, '${main_video['slug']}')">Save</span> <i id="video-save-btn" onClick="saveVideo(${main_video['id']}, '${main_video['slug']}')" data-save-status="${data.watchlist}" class="gfg-icon gfg-icon_bookmark"></i></div>
                            <div class="icon-div like-icon"><span class="like-icon-span" id="like-icon-span" onClick="likeVideo(${main_video['id']}, '${main_video['slug']}')">Like</span> <i id="video-like-btn" onClick="likeVideo(${main_video['id']}, '${main_video['slug']}')" data-like-status="${data.liked}" class="gfg-icon gfg-icon_thumbs"></i></div>
                        </div>`;
                        hasLikeBtn = true;
                    } else {
                      share_section_content+= `<div class="share-icons-main">
                            <div class="icon-div save-icon"><span class="save-icon-span" id="save-icon-span" onClick="saveVideo(${main_video['id']}, '${main_video['slug']}')">Save</span> <i id="video-save-btn" onClick="saveVideo(${main_video['id']}, '${main_video['slug']}')" class="gfg-icon gfg-icon_bookmark"></i></div>
                            <div class="icon-div like-icon"><span class="like-icon-span" id="like-icon-span" onClick="likeVideo(${main_video['id']}, '${main_video['slug']}')">Like</span> <i id="video-like-btn" onClick="likeVideo(${main_video['id']}, '${main_video['slug']}')" class="gfg-icon gfg-icon_thumbs"></i></div>
                        </div>`;
                  }
                } else {
                      share_section_content+= `<div class="share-icons-main">
                            <div class="icon-div save-icon"><span class="save-icon-span" id="save-icon-span" onClick="saveVideo(${main_video['id']}, '${main_video['slug']}')">Save</span> <i id="video-save-btn" onClick="saveVideo(${main_video['id']}, '${main_video['slug']}')" class="gfg-icon gfg-icon_bookmark"></i></div>
                            <div class="icon-div like-icon"><span class="like-icon-span" id="like-icon-span" onClick="likeVideo(${main_video['id']}, '${main_video['slug']}')">Like</span> <i id="video-like-btn" onClick="likeVideo(${main_video['id']}, '${main_video['slug']}')" class="gfg-icon gfg-icon_thumbs"></i></div>
                        </div>`;
                }
                
                //Load share section
                // $(".video-share-section").html(share_section_content);

                // let exitCond = 0;

                // const delay = (delayInms) => {
                //   return new Promise(resolve => setTimeout(resolve, delayInms));
                // }

                // while(!loginData){
                //   let delayres =  await delay(1000);
                //   exitCond+=1;
                //   console.log(exitCond);
                //   if(exitCond>5){
                //     break;
                //   }
                // }
                // console.log(loginData);
                /*if(hasLikeBtn && loginData && loginData.isLoggedIn == true){
                    setLiked(data.liked)
                    setSaved(data.watchlist)
                }*/
                
            } catch (error) {
                console.log(error);
            }
            
          }
            
          

            //Load video content like title, description
            if(false){
            $(".video-content-section").html(`
              <div class="video-title">
                ${main_video['title']}
              </div>
              <div class="video-description" id="video_id-${main_video['id']}">
                ${hideMainVideoDescription(main_video['description'], main_video['id'])}
              </div>
              ${getTagsString(main_video['category'])}
                
              ${(course_link.length)? `<div class="explore-all-btn-main">
                  <a href="${course_link}"><span class="explore-all-btn">
                    View Course <span class="gfg-icon gfg-icon_arrow-right_filled_navy_blue"></span>
                  </span></a>
              </div>`:''}
              
            `);

            let related_vidoes = main_video['recommendations'];
            
            if(!!videos && videos.length>0){
                //Load related videos
                $(".related-videos-content").html(getvideosContent());
            }
            }
            //show video content
            // element = document.getElementById('article-video-tab-content');
            // element.style.display = 'block';
            $('.spinner-loading-overlay:eq(0)').remove();
            $('.spinner-loading-overlay:eq(0)').remove();

          }

          await showMainVideoContent(video_data, course_link);
          // fitRelatedVideosDescription();
        } catch (error) {
          console.log(error);
        }
       
      }
      getVideoData();
      
      /* $(window).resize(function(){
        onWidthChangeEventsListener();
      });

      $('#video_nav_tab').click('on', function(){
        fitRelatedVideosDescription();
       });*/
    });
</script>
                                      </div>
                                                                        <div class="article-meta-author-details">
                                        <div class="article-meta-author-details-block">
                                            <div class="article-meta-author-details-profile-display">
                                                <div class="article-meta-author-details-profile-display-icon">
                                                    <a href="https://www.geeksforgeeks.org/user/Samdare B/contributions/?itm_source=geeksforgeeks&itm_medium=article_author&itm_campaign=auth_user" style="text-decoration: none;"><div class="image-wrap" style="position: relative"><p class="profileCard-profile-picture" style="background-color:#B0DAFF;  margin:0px;">S</p>
        <div style="position: absolute;top: -35px; left: -13px;">
            <i class="gfg-badge-icon md scholar"></i>
        </div>
        </div>
</a>                                                </div>
                                                <div class="article-meta-author-details-profile-display-name" >
                                                    <a aria-label="author profile" href="https://www.geeksforgeeks.org/user/Samdare B/contributions/?itm_source=geeksforgeeks&itm_medium=article_author&itm_campaign=auth_user" style="display: block;overflow: hidden;width: 65px;text-decoration: none;text-overflow: ellipsis;color: var(--gfg-title-color);font-weight: bold;white-space: nowrap;">Samdare B</a>                                                </div>
                                            </div>
                                            <div class="article-meta-author-details-follow-button">
            <div class="follow-container">
            <div class="follow-btn hideIt" >
<button id="followAuthor" type="button" onclick ="followOrUnfollowAuthor()" value="Samdare B">
<span role="img" aria-label="plus" class="plus-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"></path><path d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"></path></svg></span> <span style="font-weight: bold;">Follow</span></button></div></div></div>                                        </div>
                                        <div class="article_bottom_suggestion_wrapper">
                                            
    <div class='discussion_panel' data-title='Comments'>
        <i class='discussion_button' data-gfg-action='loadComments'>
        </i>
    </div>                                            <div pid="242709" class="article--viewer_like tooltip tooltipBottom" data-title="Like Article">
                                                <!-- <span class="tooltiptext likeTooltipBottom">Like Article</span> -->
                                                <button id="likeButton" aria-label="like article" data-gfg-action="like-article" data-bookmark-value="0" data-liked="false" style="color: #5B5A5A !important; display: flex; align-items: center; background-color: unset; margin: 0px !important; padding: 5px 0px;">
                                                    <i class="author-badge-like-button"></i>
                                                    <figure id="likeCount" style="margin-left: 3px; margin-top: 4px; color: var(--like-count-color); font-size: 14px; font-weight: 600;" class="favoriteText"></figure>
                                                </button>
                                            </div>
                                            <div class="article_bottom_suggestion" onclick="improveArticleCall()" data-title="Improve">
                                            <span class="improveTooltipBottom">Improve</span>
                                                <i class="author-badge-improvement-button"></i>
                                            </div>
                                        </div>
                                    </div>


                            <div class="d-row content-bw article-pgnavi v-divider-gfg"style="margin-top: 20px;">
                                                            <div class="article-pgnavi_prev">
                                    <a href="https://www.geeksforgeeks.org/pandas-practice-excercises-questions-and-solutions/?ref=previous_article" class="pg-head">
                                        <span class="gfg-icon gfg-icon_previous"></span>
                                        <span style="margin-left: 5px;">Previous Article</span>
                                    </a>
                                    <!-- <div class="pg-meta">8 Min Read&ensp;|&ensp;<a href="#">Java</a></div> -->
                                    <div class="pg-main">
                                        <a href="https://www.geeksforgeeks.org/pandas-practice-excercises-questions-and-solutions/?ref=previous_article">Pandas Exercises and Programs</a>
                                    </div>
                                </div>
                                                            <div class="article-pgnavi_next">
                                    <a href="https://www.geeksforgeeks.org/create-a-pandas-dataframe-from-lists/?ref=next_article" class="pg-head">
                                        <span style="margin-right: 5px; margin-left: auto;">Next Article</span>
                                        <span class="gfg-icon gfg-icon_next"></span>
                                    </a>
                                    <!-- <div class="pg-meta">8 Min Read&ensp;|&ensp;<a href="#">Java</a></div> -->
                                    <div class="pg-main">
                                        <a href="https://www.geeksforgeeks.org/create-a-pandas-dataframe-from-lists/?ref=next_article">Create a Pandas DataFrame from Lists</a>
                                    </div>
                                </div>
                                                        </div>
                            <div class="onopen-discussion-panel">
            <div class="discussion-tab">
                <div class="discussion_heading">
                    <div></div>
                    <i class="gfg-icon close-tab-icon"></i>
                </div> 
                <div class="discussion_content">    <div id="login-link" style="text-align:center;padding:10px 0px 20px 16px"> <h3>Please <u><span class="login-modal-btn" style="cursor:pointer;color: #308d46;">Login</span></u> to comment...</h3></div>
                            <div style="height:100%">
                                <div style="height:100%" id="comment-system"></div>
                            </div>

                            
</div>
            </div>
        </div>  
                        </div>
                                                </article>
                        
                                                    <div class="article--recommended article--recommended_wrapper" id="similar-reads">
                                <h3 class="new-top-bar top-bar-title">Similar Reads</h3>
                                <div class="gfg-similar-reads-list">
                                    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/different-ways-to-iterate-over-rows-in-pandas-dataframe/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Different ways to iterate over rows in Pandas Dataframe</div>
                <div class="gfg-similar-read-item-subheading">In this article, we will cover how to iterate over rows in a DataFrame in Pandas. Example # Defining a function to applydef print_row(row): print(f&quot;Name: {row['Name']}, Age: {row['Age']}&quot;)# Iterating over rows using apply()df.apply(print_row, axis=1)[embed]https://www.youtube.com/watch?v=mT-2AxZLtvw&amp;amp;t=179s[/embed] Pandas Loop through RowsPandas</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">3 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/pandas-dataframe-assign/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Pandas DataFrame assign() Method | Create new Columns in DataFrame</div>
                <div class="gfg-similar-read-item-subheading">Python is a great language for data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, making importing and analyzing data much easier. The Dataframe.assign() method assigns new columns to a DataFrame, returning a new object (a copy) with the new columns added to the original one</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">4 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/ways-to-create-nan-values-in-pandas-dataframe/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Ways to Create NaN Values in Pandas DataFrame</div>
                <div class="gfg-similar-read-item-subheading">Let's discuss ways of creating NaN values in the Pandas Dataframe. There are various ways to create NaN values in Pandas dataFrame. Those are: Using NumPy Importing csv file having blank values Applying to_numeric function Method 1: Using NumPy C/C++ Code import pandas as pd import numpy as np num = {'number': [1,2,np.nan,6,7,np.nan,np.nan]} df = p</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">1 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/pandas-dataframe-hist/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Pandas DataFrame hist() Method | Create Histogram in Pandas</div>
                <div class="gfg-similar-read-item-subheading">A histogram is a graphical representation of the numerical data. Sometimes you'll want to share data insights with someone, and using graphical representations has become the industry standard. Pandas.DataFrame.hist() function plots the histogram of a given Data frame. It is useful in understanding the distribution of numeric variables. This functi</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">4 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/difference-between-spark-dataframe-and-pandas-dataframe/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Difference Between Spark DataFrame and Pandas DataFrame</div>
                <div class="gfg-similar-read-item-subheading">Dataframe represents a table of data with rows and columns, Dataframe concepts never change in any Programming language, however, Spark Dataframe and Pandas Dataframe are quite different. In this article, we are going to see the difference between Spark dataframe and Pandas Dataframe. Pandas DataFrame Pandas is an open-source Python library based o</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">3 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/pandas-dataframe-to_numpy-convert-dataframe-to-numpy-array/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Pandas Dataframe.to_numpy() - Convert dataframe to Numpy array</div>
                <div class="gfg-similar-read-item-subheading">Pandas DataFrame is a two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). This data structure can be converted to NumPy ndarray with the help of the DataFrame.to_numpy() method. In this article we will see how to convert dataframe to numpy array. Syntax of Pandas DataFrame.to_numpy()</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">3 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/convert-given-pandas-series-into-a-dataframe-with-its-index-as-another-column-on-the-dataframe/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Convert given Pandas series into a dataframe with its index as another column on the dataframe</div>
                <div class="gfg-similar-read-item-subheading">First of all, let we understand that what are pandas series. Pandas Series are the type of array data structure. It is one dimensional data structure. It is capable of holding data of any type such as string, integer, float etc. A Series can be created using Series constructor. Syntax: pandas.Series(data, index, dtype, copy) Return: Series object.</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">1 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/how-to-convert-wide-dataframe-to-tidy-dataframe-with-pandas-stack/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">How to Convert Wide Dataframe to Tidy Dataframe with Pandas stack()?</div>
                <div class="gfg-similar-read-item-subheading">We might sometimes need a tidy/long-form of data for data analysis. So, in python's library Pandas there are a few ways to reshape a dataframe which is in wide form into a dataframe in long/tidy form. Here, we will discuss converting data from a wide form into a long-form using the pandas function stack(). stack() mainly stacks the specified index</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">4 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/replace-values-of-a-dataframe-with-the-value-of-another-dataframe-in-pandas/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Replace values of a DataFrame with the value of another DataFrame in Pandas</div>
                <div class="gfg-similar-read-item-subheading">In this article, we will learn how we can replace values of a DataFrame with the value of another DataFrame using pandas. It can be done using the DataFrame.replace() method. It is used to replace a regex, string, list, series, number, dictionary, etc. from a DataFrame, Values of the DataFrame method are get replaced with another value dynamically.</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">4 min read</span>
            </div>
        </a>
    
        <a class="gfg-similar-read-item" href="https://www.geeksforgeeks.org/converting-pandas-dataframe-to-dask-dataframe/">
            <div class="gfg-similar-read-item-content">
                <div class="gfg-similar-read-item-heading">Converting Pandas Dataframe To Dask Dataframe</div>
                <div class="gfg-similar-read-item-subheading">In this article, we will delve into the process of converting a Pandas DataFrame to a Dask DataFrame in Python through several straightforward methods. This conversion is particularly crucial when dealing with large datasets, as Dask provides parallel and distributed computing capabilities, allowing for efficient handling of substantial data volume</div>
            </div>
            
            <div class="reading-time">
                <i class="reading-time-icon" data-gfg-action="readingtime"></i>
                <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">3 min read</span>
            </div>
        </a>
                                    </div>
                                                                    <button id="showMoreRecommendedBtn" class="show-more-Articles-button">View More Articles</button>
                                                            </div>
                        

                        <div class="bottom-wrap" style="padding: 0px 20px;margin-bottom: 10px;">
                                                            <div class="improved">
                                    <div class="t-head">Article Tags : </div>
                                    <ul>
                                        
                <li style="border-radius: 25px;" class="">
                    <a href="https://www.geeksforgeeks.org/category/ai-ml-ds/">AI-ML-DS</a>
                </li>
                <li style="border-radius: 25px;" class="">
                    <a href="https://www.geeksforgeeks.org/category/programming-language/python/">Python</a>
                </li>
                <li style="border-radius: 25px;" class="">
                    <a href="https://www.geeksforgeeks.org/tag/python-pandas-dataframe/">Python pandas-dataFrame</a>
                </li>
                <li style="border-radius: 25px;" class="">
                    <a href="https://www.geeksforgeeks.org/tag/python-pandas/">Python-pandas</a>
                </li>                                    </ul>
                                                                    </div>
                                                                                        <div class="improved">
                                    <div class="t-head">Practice Tags : </div>
                                    <ul class="practice-tags">
                                        <li><a href="https://www.geeksforgeeks.org/explore?category=python">python</a></li>                                    </ul>
                                                                    </div>
                                                    </div>
                                                <div class="vote-wrap">
                                <div style="display:none;align-items:center;justify-content:center;width:100%;">
                                    <button aria-label="like" data-type="like" class="vote-this" style="margin-right: 0; margin-left:0 ;">
                                        <i class="gfg-icon gfg-icon_like favoriteIcon"></i>
                                        <span class="favoriteLike">Like</span>
                                        <figure class="favoriteText"></figure>
                                    </button>
                                                                    </div>
                            </div>

                        </div>
                            <div class="article-meta">
                                                                                    <div class="bottom-wrap">
                              <div id="GFG_AD_InContent_Desktop_BTF_650x250" style="min-height:280px;text-align:center;max-height: 300px;"></div>
                            </div>
                                                        <!-- end -->
                        </div>
                    </div>
                </div>
            </div>
        
        <div id="report_modal_content" class="report_modal_content" style="display:hidden;"></div>

        <div class="rightBar">
                
<style>
	.article--container_content{
		align-items: unset !important;
	}
	.sideBar {
		position: sticky !important;
	}
	.gfg-icon_switch::after {
		background-position: -40px -281px !important;
	}
	.gfg-icon_transaction::after {
		background-position: -40px -321px !important;
	}
	.header-main__profile.selected+.mega-dropdown{
		width: 225px !important;
	}
	#courses-container .course-price{
		display:none;
	}
	/* .side--container_wscard .card-content .content .meta:empty, .practiceBannerFromPlugin{
		display:none !important;
	} */
	.side--container_wscard .card-content .content .meta{
		display:block !important;
	}
	.side--container_wscard .card-content .content .meta p{
		background-color: rgba(254, 212, 91, 0.6);
		font-size: 10pt;
		font-weight: bold;
		display: inline-block;
		color: var(--color-black);
		margin-top: 15px;
		padding: 0px 5px;
	}
	#try-it{
		display:initial !important;
	}
	#try-it .try-it-div{
		line-height: 34px;
	}
	.gfg-icon_dark-mode::after {
		background-position: -40px -680px;
	}
	.side--container_wscard .head{
		font-size: 14px !important;
	}
	.nineDot-menu, .gfg-icon_ndot{
		display: none;
	}
	#text-15{
		flex-direction: column;
	}
	.mtq_correct_marker, .mtq_wrong_marker{
		display: none;
	}
	.sidebar_wrapper > :last-child{
		margin: unset !important;
		margin-left: 5px !important;
		margin-top: 20px !important;
		top: 70px !important;
	}
	.darkMode-wrap{
		bottom:1% !important;
	}
	#secondary .textwidget{
		margin-left: auto;
		margin-right: 0;
		text-align: right;
	}
	#secondary .widget_text:last-child{
		top: 70px !important;
	}
	@media(max-width:768px){
		#scrollTopBtn{
			display:none !important;
		}
	}
	.rightbar_loggedin_promo_cta{
		display:flex;
		cursor:pointer;
		margin-bottom:20px;
	}
</style>

<div id="secondary" class="widget-area">
	<div class='OINTechPromoRightBarBanner' style='text-align:right; margin-bottom:5px;'><a href=https://www.geeksforgeeks.org/geeksforgeeks-premium-subscription?itm_source=geeksforgeeks&itm_medium=rightbar&itm_campaign=adoutsideindia><img src=https://media.geeksforgeeks.org/auth-dashboard-uploads/new-premium-rbanner.png alt='three90RightbarBannerImg' style='width:300px; height:250px;'></a></div>
	<!------------------------ text-15 (for Ads) ------------------------ -->
	<aside id="text-15" class="widget widget_text">
		<div class="textwidget">
					<div id="_GFG_ABP_Desktop_RightSideBar_ATF_300x600_2"></div>
			<div id="GFG_AD_Desktop_RightSideBar_ATF_300x250_2" style="min-width: 300px;margin-bottom:10px;"></div>
			<div id='GFG_AD_Desktop_RightSideBar_ATF_300x600' style='min-width: 300px; min-height: 600px;margin-bottom:10px;'></div>
					</div>
	</aside>

	<!------------------------ text-16 (For Ads)------------------------ -->
	<aside id="text-16" class="widget widget_text">
		<div class="textwidget">
					<div id="_GFG_ABP_Desktop_RightSideBar_MTF_300x600"></div>
			<div id='GFG_AD_Desktop_RightSideBar_MTF_300x250' style='min-width: 300px;'></div>
			<div id="_GFG_ABP_Desktop_RightSideBar_BTF_300x600"></div>
			<div id="_GFG_ABP_Desktop_RightSideBar_BTF_300x600_3"></div>
				</div>
	</aside>

	<!-- ---------------------- courses section ------------------------- -->
	<style>.right-bar-explore-more{ visibility: hidden; min-height: 230px;text-align:left;min-width:300px;max-width:300px; padding-left: 19px; padding-right: 25px; margin-top: 20px;}
        .right-bar-explore-more .title{text-align:left;font-size:20px; font-weight: 600; line-height: 22px; color:var(--em-heading);padding:14px 0;font-family:var(--font-primary)}
        .right-bar-explore-more .rightbar-sticky-ul {list-style: disc outside; padding-left: 17px;} 
        .right-bar-explore-more li{font-size: 14px !important;font-weight: 400;line-height: 18px !important;color: var(--em-text);margin: 14px 0;font-family:var(--font-primary);}
        .right-bar-explore-more li::marker{color: var(--em-text) !important;}
        .right-bar-explore-more .rightbar-sticky-ul a{text-align:left !important; color: var(--em-text); display: block !important;}  
        .right-bar-explore-more .rightbar-sticky-ul a:hover{text-decoration:underline;color:var(--em-link)!important;}
        .right-bar-explore-more hr {margin: 0;background-color: var(--tn-hr);}
        @media (max-width: 991px){
          .right-bar-explore-more{
            width: 85%;
            margin: auto;
            margin-top: 20px;
            max-width: unset;
            display: none !important;
          }
        
          #text-18 .textwidget{
            width: 100%;
          }
        }</style>    <script>
        var rightBarExploreMoreList = `<li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/python-programming-language-tutorial/" target="_blank" style="font-family:var(--font-primary)">Python Tutorial | Learn Python Programming</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/python-interview-questions/" target="_blank" style="font-family:var(--font-primary)">Top 50+ Python Interview Questions and Answers (Latest 2024)</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/" target="_blank" style="font-family:var(--font-primary)">Python Projects - Beginner to Advanced</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/python-web-development-django/" target="_blank" style="font-family:var(--font-primary)">Python Web Development With Django</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/machine-learning/" target="_blank" style="font-family:var(--font-primary)">Machine Learning Tutorial</a></li>`
	</script>

	<!-------------------------------- Text-18 (explore more section + ads) --------------------------->
	<aside id="text-18" class="widget widget_text">
		<div class="textwidget">
					<div class="right-bar-explore-more" style="display:none;visibility: unset;">
				<div class="title">Explore More</div>
				<ul class="rightbar-sticky-ul"></ul>
			</div>
							<div id='GFG_AD_Desktop_RightSideBar_BTF_Sticky_300x250' style='min-width: 300px;margin-bottom:10px'></div>
			<div id='GFG_AD_Desktop_RightSideBar_Docked_160x600' style='min-width: 160px;'></div><div id='GFG_AD_Desktop_RightSideBar_BTFdocked_300x600' style='min-width: 300px;'></div>
			</aside>

	<!-------------------------- Text -20 (For maintaining some CSS) ---------------------- -->
	<aside id="text-20" class="widget widget_text">
		<div class="textwidget">
		 <!-- Please do not delete this div -->
		</div>
	</aside>
</div>

                <div id="user-personal-note" style="display: none;"></div>
        </div>
    </div>
    <section class="disqus-section">
        <div class="article-page_flex">
            <div class="leftBar">
            </div>
        </div>
    </section>
</div>

<div id="video-popup" style="display:none"></div>

<link rel="stylesheet" href='https://www.geeksforgeeks.org/wp-content/themes/iconic-one/css/articleList.min.css?ver=1.5'>

<script>
$(document).ready(function() {
    var isfollowingApiCall = false;
    if ($('.follow-btn').length) {
        var articleRecommendedTop = $(".article--recommended").offset().top;
        var articleRecommendedBottom = articleRecommendedTop + $(".article--recommended").outerHeight();
        $(window).scroll(function() {
            var top_of_element = $(".article--recommended").offset().top;
            var bottom_of_element = $(".article--recommended").offset().top + $(".article--recommended").outerHeight();
            var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight();
            var top_of_screen = $(window).scrollTop();
            if ((bottom_of_screen > top_of_element && top_of_screen < bottom_of_element) || 
                (bottom_of_screen > articleRecommendedTop && top_of_screen < articleRecommendedBottom) ||
                (top_of_screen > articleRecommendedBottom)) {
                if (!isfollowingApiCall) {
                    isfollowingApiCall = true;
                    setTimeout(function(){
                        if (loginData && loginData.isLoggedIn) {
                            if (loginData.userName !== $('#followAuthor').val()) {
                                is_following();
                            } else {
                                $('.profileCard-profile-picture').css('background-color', '#E7E7E7');
                            }
                        } else {
                            $('.follow-btn').removeClass('hideIt');
                        }
                    }, 3000);
                }
            }
        });
    }
    
    $(".accordion-header").click(function() {
        var arrowIcon = $(this).find('.bottom-arrow-icon');
        arrowIcon.toggleClass('rotate180');
    });

});

window.isReportArticle = false;
function report_article(){
    if (!loginData || !loginData.isLoggedIn) {
    if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) {
        $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click();
    }
    return;
}

    if(!window.isReportArticle){
            //to add loader
            $('.report-loader').addClass('spinner');
            jQuery('#report_modal_content').load(gfgSiteUrl+'wp-content/themes/iconic-one/report-modal.php', {
                PRACTICE_API_URL: practiceAPIURL,
                PRACTICE_URL:practiceURL
            },function(responseTxt, statusTxt, xhr){
                if(statusTxt == "error"){
                    alert("Error: " + xhr.status + ": " + xhr.statusText);
                }
            });
    }else{
        window.scrollTo({ top: 0, behavior: 'smooth' });
        $("#report_modal_content").show();
    }
} 

function closeShareModal() {
    const shareOption = document.querySelector('[data-gfg-action="share-article"]');
    shareOption.classList.remove("hover_share_menu");
    let shareModal = document.querySelector(".hover__share-modal-container");
    shareModal && shareModal.remove();
}

function openShareModal() {
    closeShareModal(); // Remove existing modal if any

    let shareModal = document.querySelector(".three_dot_dropdown_share");
    shareModal.appendChild(Object.assign(document.createElement("div"), { className: "hover__share-modal-container" }));

    document.querySelector(".hover__share-modal-container").append(
        Object.assign(document.createElement('div'), { className: "share__modal" }),
    );

    document.querySelector(".share__modal").append(Object.assign(document.createElement('h1'), { className: "share__modal-heading" }, { textContent: "Share to" }));
    const socialOptions = ["LinkedIn", "WhatsApp", "Copy Link"];

    socialOptions.forEach((socialOption) => {
        const socialContainer = Object.assign(document.createElement('div'), { className: "social__container" });
        const icon = Object.assign(document.createElement("div"), { className: `share__icon share__${socialOption.split(" ").join("")}-icon` });
        const socialText = Object.assign(document.createElement("span"), { className: "share__option-text" }, { textContent: `${socialOption}` });
        const shareLink = (socialOption === "Copy Link") ? 
            Object.assign(document.createElement('div'), { role: "button", className: "link-container CopyLink" }) : 
            Object.assign(document.createElement('a'), { className: "link-container" });

       
        if (socialOption === "LinkedIn") {
            shareLink.setAttribute('href', `https://www.linkedin.com/sharing/share-offsite/?url=${window.location.href}`);
            shareLink.setAttribute('target', '_blank');
        }
        if (socialOption === "WhatsApp") {
            shareLink.setAttribute('href', `https://api.whatsapp.com/send?text=${window.location.href}`); 
            shareLink.setAttribute('target', "_blank");
        }

        shareLink.append(icon, socialText);
        socialContainer.append(shareLink);
        document.querySelector(".share__modal").appendChild(socialContainer);

        //adding copy url functionality
        if(socialOption === "Copy Link") {
            shareLink.addEventListener("click", function() {
                var tempInput = document.createElement("input");
                tempInput.value = window.location.href; 
                document.body.appendChild(tempInput); 
                tempInput.select();
                tempInput.setSelectionRange(0, 99999); // For mobile devices
                document.execCommand('copy');
                document.body.removeChild(tempInput);
                this.querySelector(".share__option-text").textContent = "Copied"
            })
        }
    });
    document.querySelector(".hover__share-modal-container").addEventListener("mouseover", () => document.querySelector('[data-gfg-action="share-article"]').classList.add("hover_share_menu"));
}
function toggleLikeElementVisibility(selector, show) {
    document.querySelector(`.${selector}`).style.display = show ? "block" : "none";
}

function closeKebabMenu(){
  document.getElementById("myDropdown").classList.toggle("show");
}
</script>
<!-- Script for the new design of similar read  -->
<script>
$(document).ready(function() {
    $("#showMoreRecommendedBtn").click(function() {
        $('.gfg-similar-reads-list > .gfg-similar-read-item').show();
        $(this).hide(); // Hide the "View More" button
    });

    $("#showMoreTagsBtn").click(function() {
        $('.articles-hidden-tags').show();
        $(this).hide();
    });

    $("#showMorePracticeTagsBtn").click(function() {
        $(".practice-tags li:nth-child(n+5)").show();
        $(this).hide();
    });
});
</script>
<!-- Script end for similar read -->
<style>
        .grecaptcha-badge {
            visibility: hidden !important;
        }
        .thank-you-message-content {
            margin-top: 17px;
            font: 400 20px var(--font-secondary);
            color: var(--improve-modal-text);
            line-height: 180%;
            text-align: center;
        }
        .thank-you-message-content h2{
          font-family: var(--font-secondary);
        }
        .all-footer-information{
          width: 100% !important;;
        }
        .footer-wrapper_links-list{
           margin-block-start: 0em !important;
           width: 16% !important; 
           padding-inline-start: 18px !important;
        }
        .link-head{
               margin-bottom: 0px;
        }
        @media only screen and (max-width:1340px) {
              .footer-wrapper_links-list{
              overflow-wrap: break-word;
          }
        }
        @media screen and (min-width: 991px)  {
              .all-footer-information{
                padding-left:15px;
          }
        }
        @media only screen and (max-width:980px) {
          .footer-wrapper_branding-address{
               padding-top: 10px;
          }
        }
        @media (max-width: 750px) {
            .thank-you-message-content{
                font-size: 14px;
                line-height: 170%;
            }
        }

        /* CSS variable meant to handle the dark and light mode icon for three 90 event in header courses dropdown */
        :root{
          --three90headericon : url('https://media.geeksforgeeks.org/auth-dashboard-uploads/three90daylogocompressed.svg');
          --three90headericonposition : 0px -40px;
          --three90leftbarimggrid : url('https://media.geeksforgeeks.org/auth-dashboard-uploads/three90leftbarspritecompressed.svg');
          --three90leftbarimgposition : -5px -55px;
          --three90leftbarbgcolour : #b3abd0;
        }

        body[data-dark-mode="true"]{
          --three90leftbarimgposition : -6px 1px;
          --three90headericonposition : 0px 0px;
          --three90leftbarbgcolour: #8c82b9;
        }

        .three90leftbarimg{
          margin-left: -5px;
          height: 30px;
          background-image: var(--three90leftbarimggrid);
          background-repeat: no-repeat;
          background-position: var(--three90leftbarimgposition);
          background-size: 212px;
        }

        .courseTabShimmer{
          position: absolute;
          height: 110%;
          width: 0;
          opacity: .7;
          -webkit-animation: courseShimmer 2s cubic-bezier(0,0,.07,.61) infinite;
          animation: courseShimmer 2s cubic-bezier(0,0,.07,.61) infinite;
          box-shadow: 0 0 25px 5px #dddcdc;
          -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
          padding:0px !important;
          border:unset !important;
        }

        @keyframes courseShimmer{
          0% {
              left: 0;
          }
          55% {
              left: 100%;
          }
          99% {
              left: 110%;
          }
        }

</style>


	</div><!-- #main .wrapper -->
  <div id="displayModal" class="modal fade" role="dialog">
    <div class="modal-dialog">
      <!-- <div class="upper-box">
        <h3 style="font: normal normal bold 18px/31px var(--font-primary); color: var(--color-black);">Improve your Coding Skills with Practice</h3>
        <button class="upper-box-btn"><a style="color: white !important;" href="https://practice.geeksforgeeks.org/explore?page=1&sortBy=submissions&utm_source=gfg&utm_medium=search-bar&utm_campaign=practice-search">Try It!</a></button>
      </div> -->
      <div class="modal-content">
        <div class="error-message"></div>
        <!-- <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" data-modal="displayModal">&times;</button>
          <h2 class="modal-title" id="dmTitle"></h2>
        </div> -->
        <div class="modal-body" id="dmBody">
            <div id="modal-dm-content"></div>
              <div class="modal-overlay" aria-hidden=true>
                <span class="loader__animation"></span>
              </div>
            <!-- body -->
        </div>
        <div class="modal-footer">
          <!-- button -->
        </div>
      </div>
    </div>
  </div>  
  <div id="displayModalBackdrop" class="backdrop"></div>
  <!-- Footer start -->
  <footer class="gfg-footer" id="gfg-footer">
      <div class="footer-wrapper">
          <div class="footer-wrapper_branding">
              <a class="footer-wrapper_branding-anchor" aria-label="GeeksforGeeks Logo" href="https://www.geeksforgeeks.org/">
                <img style="height: 32px; width: 230px; max-width: fit-content;" class="footer-wrapper_branding-nlogo" src="https://media.geeksforgeeks.org/auth-dashboard-uploads/gfgFooterLogo.png" alt="geeksforgeeks-footer-logo"/>
              </a>
              <div class="footer-wrapper_branding-address">
                  <i class="gfg-icon gfg-icon_pin"></i>
                  <span style="margin-right: 15px;">
                     Corporate & Communications Address:- A-143, 9th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305) | Registered Address:- K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305                      </span>
              </div>
              <div class="footer-wrapper_branding-social">
                  <a href="https://www.facebook.com/geeksforgeeks.org/" rel="noopener noreferrer" aria-label="GeeksforGeeks Facebook" target="_blank">
                      <div class="facebook"></div>
                  </a>
                  <a href="https://www.instagram.com/geeks_for_geeks/" rel="noopener noreferrer" aria-label="GeeksforGeeks Instagram" target="_blank">
                      <div class="instagram"></div>
                  </a>
                  <a href="https://in.linkedin.com/company/geeksforgeeks" rel="noopener noreferrer" aria-label="GeeksforGeeks LinkedIn" target="_blank">
                      <div class="linkedin"></div>
                  </a>
                  <a href="https://twitter.com/geeksforgeeks" rel="noopener noreferrer" aria-label="GeeksforGeeks Twitter" target="_blank">
                      <div class="twitter"></div>
                  </a>
                  <a href="https://www.youtube.com/geeksforgeeksvideos" rel="noopener noreferrer" aria-label="GeeksforGeeks YouTube" target="_blank">
                      <div class="youtube"></div>
                  </a>
                </div>
              <div class="footer-wrapper_branding-app">
                  <a aria-label="GeeksforGeeks App Link" href="https://geeksforgeeksapp.page.link/gfg-app" target="_blank" ><img src="https://media.geeksforgeeks.org/auth-dashboard-uploads/googleplay.png" alt="GFG App on Play Store" id="gplay" loading="lazy"></a>
                  <a aria-label="GeeksforGeeks App Link" href="https://geeksforgeeksapp.page.link/gfg-app" target="_blank"><img src="https://media.geeksforgeeks.org/auth-dashboard-uploads/appstore.png" alt="GFG App on App Store" id="appstore" loading="lazy"></a>
              </div>
          </div> 
        <div class="all-footer-information">
          <div class="footer-wrapper_links" style="justify-content: space-between; text-align: -webkit-left;"><ul class="footer-wrapper_links-list" ><li>Company</li><li><a href=https://www.geeksforgeeks.org/about/?ref=outindfooter>About Us</a></li><li><a href=https://www.geeksforgeeks.org/legal/?ref=outindfooter>Legal</a></li><li><a href=https://www.geeksforgeeks.org/press-release/?ref=outindfooter>In Media</a></li><li><a href=https://www.geeksforgeeks.org/about/contact-us/?ref=outindfooter>Contact Us</a></li><li><a href=https://www.geeksforgeeks.org/advertise-with-us/?ref=outindfooter>Advertise with us</a></li><li><a href=https://www.geeksforgeeks.org/gfg-corporate-solution/?ref=outindfooter>GFG Corporate Solution</a></li><li><a href=https://www.geeksforgeeks.org/campus-training-program/?ref=outindfooter>Placement Training Program</a></li><li><a href=https://www.geeksforgeeks.org/community/?ref=outindfooter>GeeksforGeeks Community</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/introduction-to-programming-languages/?ref=outindfooter>Languages</a></li><li><a href=https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter>Python</a></li><li><a href=https://www.geeksforgeeks.org/java/?ref=outindfooter>Java</a></li><li><a href=https://www.geeksforgeeks.org/c-plus-plus/?ref=outindfooter>C++</a></li><li><a href=https://www.geeksforgeeks.org/php-tutorials/?ref=outindfooter>PHP</a></li><li><a href=https://www.geeksforgeeks.org/golang/?ref=outindfooter>GoLang</a></li><li><a href=https://www.geeksforgeeks.org/sql-tutorial/?ref=outindfooter>SQL</a></li><li><a href=https://www.geeksforgeeks.org/r-tutorial/?ref=outindfooter>R Language</a></li><li><a href=https://www.geeksforgeeks.org/android-tutorial/?ref=outindfooter>Android Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/geeksforgeeks-online-tutorials-free/?ref=outindfooter>Tutorials Archive</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outindfooter>DSA</a></li><li><a href=https://www.geeksforgeeks.org/data-structures/?ref=outindfooter>Data Structures</a></li><li><a href=https://www.geeksforgeeks.org/fundamentals-of-algorithms/?ref=outindfooter>Algorithms</a></li><li><a href=https://www.geeksforgeeks.org/complete-guide-to-dsa-for-beginners/?ref=outindfooter>DSA for Beginners</a></li><li><a href=https://www.geeksforgeeks.org/basic-coding-problems-in-dsa-for-beginners/?ref=outindfooter>Basic DSA Problems</a></li><li><a href=https://www.geeksforgeeks.org/complete-roadmap-to-learn-dsa-from-scratch/?ref=outindfooter>DSA Roadmap</a></li><li><a href=https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outindfooter>Top 100 DSA Interview Problems</a></li><li><a href=https://www.geeksforgeeks.org/dsa-roadmap-for-beginner-to-advanced-by-sandeep-jain/?ref=outindfooter>DSA Roadmap by Sandeep Jain</a></li><li><a href=https://www.geeksforgeeks.org/geeksforgeeks-master-sheet-list-of-all-cheat-sheets/?ref=outindfooter>All Cheat Sheets</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/ai-ml-ds/?ref=outindfooter>Data Science & ML</a></li><li><a href=https://www.geeksforgeeks.org/data-science-tutorial/?ref=outindfooter>Data Science With Python</a></li><li><a href=https://www.geeksforgeeks.org/data-science-for-beginners/?ref=outindfooter>Data Science For Beginner</a></li><li><a href=https://www.geeksforgeeks.org/machine-learning/?ref=outindfooter>Machine Learning Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/machine-learning-mathematics/?ref=outindfooter>ML Maths</a></li><li><a href=https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outindfooter>Data Visualisation Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/pandas-tutorial/?ref=outindfooter>Pandas Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/numpy-tutorial/?ref=outindfooter>NumPy Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outindfooter>NLP Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outindfooter>Deep Learning Tutorial</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/web-technology/?ref=outindfooter>Web Technologies</a></li><li><a href=https://www.geeksforgeeks.org/html/?ref=outindfooter>HTML</a></li><li><a href=https://www.geeksforgeeks.org/css/?ref=outindfooter>CSS</a></li><li><a href=https://www.geeksforgeeks.org/javascript/?ref=outindfooter>JavaScript</a></li><li><a href=https://www.geeksforgeeks.org/typescript/?ref=outindfooter>TypeScript</a></li><li><a href=https://www.geeksforgeeks.org/learn-reactjs/?ref=outindfooter>ReactJS</a></li><li><a href=https://www.geeksforgeeks.org/nextjs/?ref=outindfooter>NextJS</a></li><li><a href=https://www.geeksforgeeks.org/bootstrap/?ref=outindfooter>Bootstrap</a></li><li><a href=https://www.geeksforgeeks.org/web-design/?ref=outindfooter>Web Design</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter>Python Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/python-programming-examples/?ref=outindfooter>Python Programming Examples</a></li><li><a href=https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/?ref=outindfooter>Python Projects</a></li><li><a href=https://www.geeksforgeeks.org/python-tkinter-tutorial/?ref=outindfooter>Python Tkinter</a></li><li><a href=https://www.geeksforgeeks.org/python-web-scraping-tutorial/?ref=outindfooter>Web Scraping</a></li><li><a href=https://www.geeksforgeeks.org/opencv-python-tutorial/?ref=outindfooter>OpenCV Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/python-interview-questions/?ref=outindfooter>Python Interview Question</a></li><li><a href=https://www.geeksforgeeks.org/django-tutorial/?ref=outindfooter>Django</a></li></ul></div><div class="footer-wrapper_links" style="justify-content: space-between; text-align: -webkit-left;"><ul class="footer-wrapper_links-list" style="margin-block-start: 0em; width:16%; padding-inline-start: 18px;"><li>Computer Science</li><li><a href=https://www.geeksforgeeks.org/operating-systems/?ref=outindfooter>Operating Systems</a></li><li><a href=https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outindfooter>Computer Network</a></li><li><a href=https://www.geeksforgeeks.org/dbms/?ref=outindfooter>Database Management System</a></li><li><a href=https://www.geeksforgeeks.org/software-engineering/?ref=outindfooter>Software Engineering</a></li><li><a href=https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/?ref=outindfooter>Digital Logic Design</a></li><li><a href=https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outindfooter>Engineering Maths</a></li><li><a href=https://www.geeksforgeeks.org/software-development/?ref=outindfooter>Software Development</a></li><li><a href=https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outindfooter>Software Testing</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/devops-tutorial/?ref=outindfooter>DevOps</a></li><li><a href=https://www.geeksforgeeks.org/git-tutorial/?ref=outindfooter>Git</a></li><li><a href=https://www.geeksforgeeks.org/linux-tutorial/?ref=outindfooter>Linux</a></li><li><a href=https://www.geeksforgeeks.org/aws-tutorial/?ref=outindfooter>AWS</a></li><li><a href=https://www.geeksforgeeks.org/docker-tutorial/?ref=outindfooter>Docker</a></li><li><a href=https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outindfooter>Kubernetes</a></li><li><a href=https://www.geeksforgeeks.org/microsoft-azure/?ref=outindfooter>Azure</a></li><li><a href=https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outindfooter>GCP</a></li><li><a href=https://www.geeksforgeeks.org/devops-roadmap/?ref=outindfooter>DevOps Roadmap</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/system-design-tutorial/?ref=outindfooter>System Design</a></li><li><a href=https://www.geeksforgeeks.org/what-is-high-level-design-learn-system-design/?ref=outindfooter>High Level Design</a></li><li><a href=https://www.geeksforgeeks.org/what-is-low-level-design-or-lld-learn-system-design/?ref=outindfooter>Low Level Design</a></li><li><a href=https://www.geeksforgeeks.org/unified-modeling-language-uml-introduction/?ref=outindfooter>UML Diagrams</a></li><li><a href=https://www.geeksforgeeks.org/system-design-interview-guide/?ref=outindfooter>Interview Guide</a></li><li><a href=https://www.geeksforgeeks.org/software-design-patterns/?ref=outindfooter>Design Patterns</a></li><li><a href=https://www.geeksforgeeks.org/object-oriented-analysis-and-design/?ref=outindfooter>OOAD</a></li><li><a href=https://www.geeksforgeeks.org/system-design-interview-bootcamp-guide/?ref=outindfooter>System Design Bootcamp</a></li><li><a href=https://www.geeksforgeeks.org/most-commonly-asked-system-design-interview-problems-questions/?ref=outindfooter>Interview Questions</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/technical-interview-preparation/?ref=outindfooter>Inteview Preparation</a></li><li><a href=https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outindfooter>Competitive Programming</a></li><li><a href=https://www.geeksforgeeks.org/top-algorithms-and-data-structures-for-competitive-programming/?ref=outindfooter>Top DS or Algo for CP</a></li><li><a href=https://www.geeksforgeeks.org/company-wise-recruitment-process/?ref=outindfooter>Company-Wise Recruitment Process</a></li><li><a href=https://www.geeksforgeeks.org/company-preparation/?ref=outindfooter>Company-Wise Preparation</a></li><li><a href=https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outindfooter>Aptitude Preparation</a></li><li><a href=https://www.geeksforgeeks.org/puzzles/?ref=outindfooter>Puzzles</a></li></ul><ul class="footer-wrapper_links-list" ><li>School Subjects</li><li><a href=https://www.geeksforgeeks.org/maths/?ref=outindfooter>Mathematics</a></li><li><a href=https://www.geeksforgeeks.org/physics/?ref=outindfooter>Physics</a></li><li><a href=https://www.geeksforgeeks.org/chemistry/?ref=outindfooter>Chemistry</a></li><li><a href=https://www.geeksforgeeks.org/biology/?ref=outindfooter>Biology</a></li><li><a href=https://www.geeksforgeeks.org/social-science/?ref=outindfooter>Social Science</a></li><li><a href=https://www.geeksforgeeks.org/english-grammar/?ref=outindfooter>English Grammar</a></li><li><a href=https://www.geeksforgeeks.org/commerce/?ref=outindfooter>Commerce</a></li><li><a href=https://www.geeksforgeeks.org/tag/world-general-knowledge/?ref=outindfooter>World GK</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/videos/?ref=outindfooter>GeeksforGeeks Videos</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/sde-sheet/?ref=outindfooter>DSA</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/python/?ref=outindfooter>Python</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/java-w6y5f4/?ref=outindfooter>Java</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/c/?ref=outindfooter>C++</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/web-development/?ref=outindfooter>Web Development</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/data-science/?ref=outindfooter>Data Science</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/cs-subjects/?ref=outindfooter>CS Subjects</a></li></ul></div>        </div> 
      </div>
            <!-- Jobs Fair 2024 related CSS changes -->

<style>
  :root{
    --home-jobs-section-jf-logo: url('https://media.geeksforgeeks.org/auth-dashboard-uploads/JobFair2024Logo.svg');
  }

  body[data-dark-mode="true"]
  {
    --home-jobs-section-jf-logo: url('https://media.geeksforgeeks.org/auth-dashboard-uploads/JobFair2024LogoDark.svg');
  }

  .hp_job_section_jf_logo, .job-a-thon-jf-sticky-header-logo{
    background: var(--home-jobs-section-jf-logo);
    height: 50px;
    background-repeat: no-repeat;
    width: 105px;
    background-size: 100px;
  }

  @keyframes challenge {
	0%{
		transform: scale(1);
	}
	50%{
		transform: scale(1.03);
	}
	100%{
		transform: scale(1);
	}
  }

  .job-a-thon-jf-sticky-header-logo{
    height: 45px;
  }

</style>

<!-- ---------------------------------- -->
      <div class="footer-strip" >
          <div class="copyright">
              <a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer" target="_blank">@GeeksforGeeks, Sanchhaya Education Private Limited</a><span>, <a href="https://www.geeksforgeeks.org/copyright-information/">All rights reserved</a></span>
          </div>
          <div class="social-links">
          </div>
      </div>
  </footer>
</div><!-- #page -->
<script type='text/javascript' src='https://www.geeksforgeeks.org/wp-includes/js/wp-embed.min.js?ver=4.9.8'></script>

<!-- Cookie Consent Div-->
<div class="cookie-consent hide-consent">
    <span class="cookie-text">
        We use cookies to ensure you have the best browsing experience on our website. By using our site, you
        acknowledge that you have read and understood our
        <a href="https://www.geeksforgeeks.org/cookie-policy/" target="_blank"><u>Cookie Policy</u></a> &
        <a href="https://www.geeksforgeeks.org/privacy-policy/" target="_blank"><u>Privacy Policy</u></a>
            </span>
    <button class="consent-btn">
        Got It !
    </button>
</div>
<!-- Cookie Consent Div ends -->

<!--Light Box Div starts-->
<div class="lightbox-target">
   <img id="lightbox-image" src="" alt="Lightbox"/>
   <span class="lightbox-close"></span>
</div>
<!--Light Box Div ends-->

<!-- <link rel="stylesheet" href="https://use.typekit.net/mrg0hpc.css"/> -->
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&family=Source+Sans+3:wght@400;600&display=swap" rel="stylesheet">
<script>
  if(post_slug.includes('premium-plans-payment/') || post_slug.includes('premium-plans/')){
    $('.darkMode-wrap').remove();
    $('.toggle-darkMode').remove();
  }

function setGoogleRecaptcha() {
    var captchaSiteKey = '6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY';
    grecaptcha.ready(function() {
        grecaptcha.execute(captchaSiteKey).then(function(token) {
            document.getElementById('g-recaptcha-response-suggestion-form').value = token;
            suggestionCall();
        });
    });
}

</script>

        <div class="improve-modal--overlay" style="display: none;">
            <div class="improve-modal--improvement" status="locked">
                <div class="improve-modal--improve-header">
                    <div class="improve-header-fst-child">Improvement</div>
                    <div class="improve-header-sec-child">
                        <i class="gfg-icon improve-cross-icon"></i>
                    </div>
                </div>
                <div class="locked-status--impove-modal">
                    <div class="improve-modal--improve-content guidelines"><span>Please go through our recently updated <a href="https://write.geeksforgeeks.org/how-to-improve" target="_blank">Improvement Guidelines</a> before submitting any improvements.</span></div>

                    <div class="improve-modal--improve-content"><span class="improve-modal--improve-content-modified">This improvement is locked by another user right now.</span> You can suggest the changes for now and it will be under 'My Suggestions' Tab on Write.</div>
                    <div class="improve-modal--improve-content" style="margin-top: 16px;">You will be notified via email once the article is available for improvement.
                        Thank you for your valuable feedback!
                    </div>
                    
                    <div class="improve-modal--improve-bottom">
                        <button class="improve-bottom-btn" type="button">Suggest changes</button>
                    </div>
                </div>
                <div class="unlocked-status--improve-modal-content">
                  <div class="improve-modal--improve-content guidelines"><span>Please go through our recently updated <a href="https://write.geeksforgeeks.org/how-to-improve" target="_blank">Improvement Guidelines</a> before submitting any improvements.</div>
                  <div class="suggest-change_wrapper">
                    <div class="suggest-change-content_wrapper">
                      <div class="suggest-change">Suggest Changes</div>
                      <div class="suggest-changes-about">Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.</div>
                    </div>
                    <div class="suggest-change-icon_wrapper">
                      <img class="suggest-change-icon" src="https://media.geeksforgeeks.org/auth-dashboard-uploads/suggestChangeIcon.png" alt="geeksforgeeks-suggest-icon"/>
                    </div>
                  </div>
                  <div class="create-improvement_wrapper">
                    <div class="create-improvement-content_wrapper">
                      <div class="create-improvement">Create Improvement</div>
                      <div class="create-improvements-about">Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.</div>
                    </div>
                    <div class="create-improvement-icon_wrapper">
                    <img class="create-improvement-icon" src="https://media.geeksforgeeks.org/auth-dashboard-uploads/createImprovementIcon.png" alt="geeksforgeeks-improvement-icon"/>
                    </div>
                  </div>
                </div>
            </div>
            <div class="improve-modal--suggestion" style="display: none;">
                <!-- Header of improve-modal--improvement and improve-modal--suggestion have same CSS rule that's why I use same class name -->
                <div class="improve-modal--improve-header">
                  <div class="left-arrow-icon_suggest_wrapper">
                    <div class="left-arrow-icon_wrapper">
                      <i class="gfg-icon improve-left-arrow-icon"></i>
                    </div>
                    <div class="improve-header-fst-child">Suggest Changes</div>
                  </div>
                  <div class="improve-header-sec-child">
                        <i class="gfg-icon improve-cross-icon"></i>
                  </div>
                </div>
                <div class="suggestion-modal-section">
                    <form>
                        <label for="suggestion-section">min 4 words, max CharLimit:2000</label>
                        <textarea id="suggestion-section-textarea" name="suggestion-section" placeholder="Write your suggestions here"></textarea>
                        <input type="hidden" name="g-recaptcha-suggestion-response" id="g-recaptcha-response-suggestion-form">
                    </form>
                </div> 
                <!-- Button of improve-modal--improvement and improve-modal--suggestion have same CSS rule that's why I use same class name -->
                <div class="improve-modal--improve-bottom suggestion-btn">
                    <p><span id="suggestion-modal-alert" style="display: none;"></span></p>
                    <button class="suggest-bottom-btn" type="button"></button>
                </div>
            </div>
            <div class="improvement-reason-modal" style="display: none;">
                <div class="improve-modal--improve-header">
                  <div class="left-arrow-icon_suggest_wrapper">
                    <div class="left-arrow-icon_wrapper">
                      <i class="gfg-icon improve-left-arrow-icon"></i>
                    </div>
                    <div class="improve-header-fst-child">Create Improvement</div>
                  </div>
                  <div class="improve-header-sec-child">
                        <i class="gfg-icon improve-cross-icon"></i>
                  </div>
                </div>
                <div class="improvement-reasons_wrapper">
                </div>
                <div class="improve-modal--improve-bottom improvement-btn">
                    <button class="improvement-bottom-btn create-improvement-btn" type="button"></button>
                </div>
            </div>
            <a href="#" style="visibility:hidden" class="create-improvement-redirection-to-write" target="_blank"></a>
        </div>
        <script>
          
            jQuery('.improve-header-sec-child').on('click', function(){
                jQuery('.improve-modal--overlay').hide();
                $('.improve-modal--suggestion').hide();
                $('.improvement-reason-modal').hide();
            });

            $('.suggest-change_wrapper, .locked-status--impove-modal .improve-bottom-btn').on('click',function(){ // when suggest changes option is clicked
              $('#suggestion-section-textarea').val("");
              $('.suggest-bottom-btn').html("Suggest changes");
              $('.improve-modal--improvement').hide();
              $('.improve-modal--suggestion').show();
            });
            $('.create-improvement_wrapper').on('click',function(){  // when create improvement option clicked then improvement reason will be shown
                if(loginData && loginData.isLoggedIn) {
              $('body').append('<div class="spinner-loading-overlay"></div>');
              $('.spinner-loading-overlay').show();
              jQuery.ajax({
                url: writeApiUrl + 'create-improvement-post/?v=1',
                type: "POST",
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                xhrFields: {
                  withCredentials: true
                },
                data: JSON.stringify({
                  gfg_id: post_id,
                  check: true
                }),
                success:function(result) {
                  jQuery.ajax({
                    url: writeApiUrl + 'suggestions/auth/' + `${post_id}/`,
                    type: "GET",
                    dataType: 'json',
                    xhrFields: {
                        withCredentials: true
                    },
                    success: function (result) {
                      $('.spinner-loading-overlay:eq(0)').remove();
                      var commentArray = result;
                      if(commentArray === null || commentArray.length === 0) {  // when no reason is availaible then user will redirected directly make the improvment.
                        // call to api create-improvement-post
                        $('body').append('<div class="spinner-loading-overlay"></div>');
                        $('.spinner-loading-overlay').show();
                        jQuery.ajax({
                          url: writeApiUrl + 'create-improvement-post/?v=1',
                          type: "POST",
                          contentType: 'application/json; charset=utf-8',
                          dataType: 'json',
                          xhrFields: {
                            withCredentials: true
                          },
                          data: JSON.stringify({
                            gfg_id: post_id,
                          }),
                          success:function(result) {
                            $('.spinner-loading-overlay:eq(0)').remove();
                            $('.improve-modal--overlay').hide();
                            $('.unlocked-status--improve-modal-content').css("display","none");
                            $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank');
                            $('.create-improvement-redirection-to-write')[0].click();
                          },
                          error:function(e) {
                            $('.spinner-loading-overlay:eq(0)').remove();
                            var result = e.responseJSON;
                            if(result.detail.non_field_errors.length){
                              $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`);
                              jQuery('.improve-modal--overlay').show();
                              jQuery('.improve-modal--improvement').show();
                              $('.locked-status--impove-modal').css("display","block");
                              $('.unlocked-status--improve-modal-content').css("display","none");
                              $('.improve-modal--improvement').attr("status","locked");
                              $('.improvement-reason-modal').hide();
                            }
                          },
                        });
                        return;
                      }
                      var improvement_reason_html = "";
                      for(var comment of commentArray) { // loop creating improvement reason list markup 
                        var comment_id = comment['id'];
                        var comment_text = comment['suggestion'];
                        improvement_reason_html += `<div>
                        <span id=${comment_id}></span>
                        <span class="reason-content">${comment_text}</span>
                        </div>`;
                      }
                      $('.improvement-reasons_wrapper').html(improvement_reason_html);
                      $('.improvement-bottom-btn').html("Create Improvement");
                      $('.improve-modal--improvement').hide();
                      $('.improvement-reason-modal').show();
                    },
                    error: function(e){
                      $('.spinner-loading-overlay:eq(0)').remove();
                        // stop loader when ajax failed;
                    },
                  });
                },
                error:function(e) {
                  $('.spinner-loading-overlay:eq(0)').remove();
                  var result = e.responseJSON;
                  if(result.detail.non_field_errors.length){
                    $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`);
                    jQuery('.improve-modal--overlay').show();
                    jQuery('.improve-modal--improvement').show();
                    $('.locked-status--impove-modal').css("display","block");
                    $('.unlocked-status--improve-modal-content').css("display","none");
                    $('.improve-modal--improvement').attr("status","locked");
                    $('.improvement-reason-modal').hide();
                  }
                },
              });
              }
              else {
               if(loginData && !loginData.isLoggedIn) {
                   $('.improve-modal--overlay').hide();
                if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) {
                $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click();
                 }
                return;
                }
              }

            });
            $('.left-arrow-icon_wrapper').on('click',function(){
              if($('.improve-modal--suggestion').is(":visible"))
              $('.improve-modal--suggestion').hide();
              else{
                $('.improvement-reason-modal').hide();
              }

              $('.improve-modal--improvement').show();
            });
            function loadScript(src, callback) {
                var script = document.createElement('script');
                script.src = src;
                script.onload = callback;
                document.head.appendChild(script);
            }
            function suggestionCall() {              
                var suggest_val = $.trim($("#suggestion-section-textarea").val());
                var array_String= suggest_val.split(" ") 
                var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val();
                var error_msg = false;
                if(suggest_val != "" && array_String.length >=4){
                    if(suggest_val.length <= 2000){
                        var payload = {
                                    "gfg_post_id" : `${post_id}`,
                                    "suggestion" : `<p>${suggest_val}</p>`,
                                }
                        if(!loginData || !loginData.isLoggedIn)                  // User is not logged in
                        payload["g-recaptcha-token"] = gCaptchaToken

                        jQuery.ajax({
                            type:'post',
                            url:  "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/",
                            xhrFields: {
                                withCredentials: true
                            },
                            crossDomain: true,
                            contentType:'application/json',
                            data: JSON.stringify(payload),
                            success:function(data) {
                                jQuery('.spinner-loading-overlay:eq(0)').remove();
                                jQuery('#suggestion-section-textarea').val("");
                                jQuery('.suggest-bottom-btn').css("display","none");
                                
                                // Update the modal content
                                const modalSection = document.querySelector('.suggestion-modal-section');
                                modalSection.innerHTML = `
                                    <div class="thank-you-message" style="text-align: center;">
                                      <h2>Thank You!</h2>
                                      <div class="thank-you-message-content">Your suggestions are valuable to us.</div>
                                      <div class="thank-you-message-content guidelines">You can now also <a href="https://write.geeksforgeeks.org/" target="_blank" id="contribute-link">contribute</a> to the GeeksforGeeks community by creating improvement and help your fellow geeks.</div>
                                    </div>
                                `;

                            },
                            error:function(data) {
                                jQuery('.spinner-loading-overlay:eq(0)').remove();
                                jQuery('#suggestion-modal-alert').html("Something went wrong.");
                                jQuery('#suggestion-modal-alert').show();
                                error_msg = true;
                            }
                        });
                    }
                    else{
                        jQuery('.spinner-loading-overlay:eq(0)').remove();
                        jQuery('#suggestion-modal-alert').html("Minimum 5 Words and Maximum Character limit is 2000.");
                        jQuery('#suggestion-modal-alert').show();
                        jQuery('#suggestion-section-textarea').focus();
                        error_msg = true;
                    }
                }
                else{
                    jQuery('.spinner-loading-overlay:eq(0)').remove();
                    jQuery('#suggestion-modal-alert').html("Enter atleast four words !");
                    jQuery('#suggestion-modal-alert').show();
                    jQuery('#suggestion-section-textarea').focus();
                    error_msg = true;
                }
                if(error_msg){
                    setTimeout(() => {
                        jQuery('#suggestion-section-textarea').focus();
                        jQuery('#suggestion-modal-alert').hide();
                    }, 3000);
                }
            }
            
            document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){
              jQuery('body').append('<div class="spinner-loading-overlay"></div>');
              jQuery('.spinner-loading-overlay').show();
              if(loginData && loginData.isLoggedIn) {
                 suggestionCall();
                 return;
              }
              // load the captcha script and set the token
              loadScript('https://www.google.com/recaptcha/api.js?render=6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY', function() {
                setGoogleRecaptcha();
              });
            });
            
            $('.improvement-bottom-btn.create-improvement-btn').click(function() {  //create improvement button is clicked
              $('body').append('<div class="spinner-loading-overlay"></div>');
              $('.spinner-loading-overlay').show();
              // send this option via create-improvement-post api
              jQuery.ajax({
                url: writeApiUrl + 'create-improvement-post/?v=1',
                type: "POST",
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                xhrFields: {
                  withCredentials: true
                },
                data: JSON.stringify({
                  gfg_id: post_id
                }),
                success:function(result) {
                  $('.spinner-loading-overlay:eq(0)').remove();
                  $('.improve-modal--overlay').hide();
                  $('.improvement-reason-modal').hide();
                  $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank');
                  $('.create-improvement-redirection-to-write')[0].click();
                },
                error:function(e) {
                  $('.spinner-loading-overlay:eq(0)').remove();
                  var result = e.responseJSON;
                  if(result.detail.non_field_errors.length){
                    $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`);
                    jQuery('.improve-modal--overlay').show();
                    jQuery('.improve-modal--improvement').show();
                    $('.locked-status--impove-modal').css("display","block");
                    $('.unlocked-status--improve-modal-content').css("display","none");
                    $('.improve-modal--improvement').attr("status","locked");
                    $('.improvement-reason-modal').hide();
                  }
                },
              });
            });
        </script>
    <script>
var AdblockPlus = new function() {
     this.detect = function(px, callback) {
         var detected = false;
         var checksRemain = 2;
         var error1 = false;
         var error2 = false;
         if (typeof callback != "function") return;
         px += "?ch=*&rn=*";

         function beforeCheck(callback, timeout) {
             if (checksRemain == 0 || timeout > 1E3) callback(checksRemain == 0 && detected);
             else setTimeout(function() {
                 beforeCheck(callback, timeout * 2)
             }, timeout * 2)
         }

         function checkImages() {
             if (--checksRemain) return;
             detected = !error1 && error2
         }
         var random = Math.random() * 11;
         var img1 = new Image;
         img1.onload = checkImages;
         img1.onerror = function() {
             error1 = true;
             checkImages()
         };
         img1.src = px.replace(/\*/, 1).replace(/\*/, random);
         var img2 = new Image;
         img2.onload = checkImages;
         img2.onerror = function() {
             error2 = true;
             checkImages()
         };
         img2.src = px.replace(/\*/, 2).replace(/\*/, random);
         beforeCheck(callback, 250)
     }
 };

/*
AdblockPlus.detect("https://cdnads.geeksforgeeks.org/res/px.gif", function(abp){
    window.googletag = window.googletag || {cmd: []};
    window.abp=abp;
    var elms = [...document.querySelectorAll('div[id^=_GFG_ABP_]')];
    const units=elms.map(elem=>elem.id)
    if(abp) {
        for(let curr_unit of units) {
            const iframe = document.createElement('iframe');
            iframe.setAttribute('src',"https://aa.geeksforgeeks.org/iframe.html?code="+curr_unit.substr(1))
            const elem = document.getElementById(curr_unit)
            const div = document.createElement('div');
            div.setAttribute('id',curr_unit.substr(1))
            let sizes = curr_unit.split("_");
            sizes = sizes.filter(val => val.includes('x'));
            let [width, height] = sizes[0].split("x");
            iframe.style.width = `${+width+20}px`
            iframe.style.height = `${+height+20}px`
            if(elem) {
                elem.appendChild(iframe);
            }
        }
        var gfgAdDivs = [...document.querySelectorAll('div[id^=GFG_AD_]')];
        gfgAdDivs.forEach(gfgDiv => document.getElementById(gfgDiv.id).removeAttribute("style"));
        jQuery('#secondary .widget_text:last-child').css({"position": "unset"});
    }
});*/
    AdblockPlus.detect("https://cdnads.geeksforgeeks.org/res/px.gif", function(abp){
    window.googletag = window.googletag || {cmd: []};
    window.abp=abp;
    var elms = [...document.querySelectorAll('div[id^=_GFG_ABP_]')];
    //const units=elms.map(elem=>elem.id)
    const units = elms
      .filter(elem => !(window.innerWidth < 1500 && elem.id === "_GFG_ABP_Incontent_728x90"))
      .map(elem => elem.id);
    if(abp) {
        isAdBlockerPresent = true;
        for(let curr_unit of units) {
            const iframe = document.createElement('iframe');
            iframe.addEventListener("load", () => {
              iframe.contentWindow.postMessage(JSON.stringify({host: window.location.host,category: window.arrPostCatName,parentWidth: window.innerWidth}),'https://aa.geeksforgeeks.org');
            });
            iframe.setAttribute('src',"https://aa.geeksforgeeks.org/iframe.html?code="+curr_unit.substr(1))
            const elem = document.getElementById(curr_unit)
            const div = document.createElement('div');
            div.setAttribute('id',curr_unit.substr(1))
            let sizes = curr_unit.split("_");
            sizes = sizes.filter(val => val.includes('x'));
            let [width, height] = sizes[0].split("x");
            iframe.style.width = `${+width+20}px`
            iframe.style.height = `${+height+20}px`
            if(elem) {
                elem.appendChild(iframe);
            }
        }
        var gfgAdDivs = [...document.querySelectorAll('div[id^=GFG_AD_]')];
        gfgAdDivs.forEach(gfgDiv => document.getElementById(gfgDiv.id).removeAttribute("style"));
        jQuery('#secondary .widget_text:last-child').css({"position": "unset"});
    }
    else{
      try {
        var isAdblockEnabled = t =>
            fetch(
                new Request('https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', {
                    method: 'HEAD',
                    mode: 'no-cors'
                })
            ).catch(t);
          isAdblockEnabled(() => {
            // here goes modal pop-up code
            isAdBlockerPresent = true;
          });
      } catch (err) {console.log(err);}
    }
});

  function closeAdBlockPopupModal(){
    const modal = document.getElementById("adBlockerModal");
    $('body').removeClass('body-for-ad-blocker');
    $('#adBlockerModal').remove()
    localStorage.setItem('gfgAdBlockPopup',new Date())
  }
  function showAdblockerModal(){
    let currTime = new Date();
    let lastTime = new Date(localStorage.getItem('gfgAdBlockPopup'));
    if(((currTime-lastTime)/(1000*60*60))<1)
    {
      return;
    }
    const adBlockerModal = `<div id="adBlockerModal" class="ad-blocker-modal">
      <div id="ad-blocker-modal-overlay">
        <div id="ad-blocker-outer-div">
          <div id="ad-blocker-div">
          <p id="ad-blocker-div-warning" style="margin-bottom: 30px;">It seems that you are using an ad blocker.<br><span style="font-size: 20px;">Please disable it to support us!</span></p>
              <div id="ad-blocker-div-btns">
                  <button id="ad-blocker-div-button1" onclick="handleAdBlockerClick('disabled')">
                      I disabled my ad blocker
                  </button>
                  <button id="ad-blocker-div-button2" onclick="handleAdBlockerClick('info')">
                      Show Me How
                  </button>
              </div>
              <div id="ad-blocker-div-continue-btn-div">
                  <a id="ad-blocker-div-continue-btn" href="#" onclick="closeAdBlockPopupModal()">Continue without supporting &#128546;</a>
              </div>
          </div>
          <div id="ad-blocker-info-div" style="display:none;">
            <div id="ad-blocker-info-div-continue-btn-div">
                <a id="ad-blocker-info-div-continue-btn" href="">I disabled my ad blocker</a>
            </div>
            <div id="ad-blocker-info-div-instructions-div">
              <p id="ad-blocker-info-div-instructions-para">Select from the following icons for instructions on how to add us to your safe sites list.</p>
            </div>
            <div id="ad-blocker-info-div-icons-div">
              <div class="ad-blocker-info-div-icons-circle-div" id="ad-blocker-info-div-icons-0" onclick="handleAdBlockerIconClick('0')">
              </div>
              <div class="ad-blocker-info-div-icons-circle-div" id="ad-blocker-info-div-icons-1" onclick="handleAdBlockerIconClick('1')">
              </div>  
              <div class="ad-blocker-info-div-icons-circle-div" id="ad-blocker-info-div-icons-2" onclick="handleAdBlockerIconClick('2')">
              </div>
              <div class="ad-blocker-info-div-icons-circle-div" id="ad-blocker-info-div-icons-3" onclick="handleAdBlockerIconClick('3')">
              </div>
            </div>
            <div id="ad-blocker-info-div-gif-div">
              <video id="ad-blocker-info-div-gif" autoplay muted loop>
                <source id="ad-blocker-info-div-gif-src" src="https://i.piano.io/managedservices/adblock-sources/videos/chrome-adblock.mp4" type="video/mp4">
              </video>
            </div>
            <div id="ad-blocker-info-div-steps-div">
              <ol id="ad-blocker-info-div-steps-ul">
                <li class="ad-blocker-info-div-steps-li">Click on the <span id="ad-blocker-info-div-name-span">uBlock</span> icon at the top right corner of your browser.</li>
                <li class="ad-blocker-info-div-steps-li">Click Enabled on this site until the text reads Disabled on this site.</li>
                <li class="ad-blocker-info-div-steps-li">Click Done below to close this window and refresh the page.</li>
              </ol>
            </div>
          </div>
        </div>
      </div>
    </div>`;
    $('body').append(adBlockerModal);
    $('body').addClass('body-for-ad-blocker');
    const modal = document.getElementById("adBlockerModal");
    modal.style.display = "block";
  }
  function handleAdBlockerClick(type){
      if(type == 'disabled'){
        window.location.reload();
      }
      else if(type == 'info'){
        document.getElementById("ad-blocker-div").style.display = "none";
        document.getElementById("ad-blocker-info-div").style.display = "flex";
        handleAdBlockerIconClick(0);
      }
  }
  var lastSelected= null;
  //Mapping of name and video URL with the index.
  const adBlockerVideoMap = [
    ['Ad Block Plus','https://media.geeksforgeeks.org/auth-dashboard-uploads/abp-blocker-min.mp4'],
    ['Ad Block','https://media.geeksforgeeks.org/auth-dashboard-uploads/Ad-block-min.mp4'],
    ['uBlock Origin','https://media.geeksforgeeks.org/auth-dashboard-uploads/ub-blocke-min.mp4'],
    ['uBlock','https://media.geeksforgeeks.org/auth-dashboard-uploads/U-blocker-min.mp4'],
  ]
  function handleAdBlockerIconClick(currSelected){
    const videocontainer = document.getElementById('ad-blocker-info-div-gif');
    const videosource = document.getElementById('ad-blocker-info-div-gif-src');
    if(lastSelected != null){
      document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.backgroundColor = "white";  
      document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.borderColor = "#D6D6D6";
    }
    document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.backgroundColor = "#D9D9D9";
    document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.borderColor = "#848484";
    document.getElementById('ad-blocker-info-div-name-span').innerHTML = adBlockerVideoMap[currSelected][0]
    videocontainer.pause();
    videosource.setAttribute('src', adBlockerVideoMap[currSelected][1]);
    videocontainer.load();
    videocontainer.play();
    lastSelected = currSelected;
  }
</script>
<!-- <script async src="https://www.googleoptimize.com/optimize.js?id=OPT-5PGZ8MN"></script> -->

<style>
/* Temporary CSS for Three90 pop up modal (START)*/
    .three90popup__container {
      width: 100vw;
      height: 100vh; 
      position: fixed;
      top:0px;
      background: var(--job-tab-faded-background);
      z-index: 1024;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .three90modal__wrapper{
      background-color: white;
      max-width: 350px;
      display: flex;
      flex-direction: column;
      border-radius: 10px;
      overflow: hidden;

    }
    .three90modal__message-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      font-family: var(--font-primary);
    }
    .three90modal__subheading {
      margin-top: 20px;
      font-size: 22px;
      font-weight: 600;
    }
    .three90modal__text-message {
      margin-top: 20px;
      font-size: 15px;
      font-weight: 400;
      text-align: center;
      padding: 0 5px;
    }
    .three90__modal__button-wrapper {
      width: 100%;
      padding: 20px 0px;
      display: flex;
      justify-content: space-evenly;
    }
    .three90__modal__button-wrapper > button {
      width: 105px;
      height: 35px;
      border-radius: 13px;
      border:none;
      font-weight: 600;
      cursor: pointer;
    } 
    #three90__modal-close-btn:hover {
      background-color: #cacbcd;
    }
    #three90__modal-explore-btn {
      background-color: #0a0727;
      color: white
    }

    @media screen and (max-width: 441px) {
      .three90modal__wrapper {
        max-width: 300px;
      }
    }

  /* Temporary CSS for Three90 pop up modal (END)*/
</style>

<script type="text/javascript" >
    const coursePromotionCities = JSON.parse(`{"NCR":{"LOCATIONS":["Noida","Greater Noida","Ghaziabad","Faridabad","Delhi"],"COURSES":[{"name":"GATE CS 2025 Classroom Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/gate-cs-2025-classroom"},{"name":"MERN Full Stack Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/mern-full-stack-development-classroom"},{"name":"DSA For Interview Preparation","url":" https:\/\/www.geeksforgeeks.org\/courses\/dsa-interview-preparation-classroom"},{"name":"JAVA Backend Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-java-backend-development-program"},{"name":"Data Analytics Programme","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-data-analytics-program"},{"name":"AWS Solutions Architect Certification","url":"https:\/\/www.geeksforgeeks.org\/courses\/aws-solutions-architect-certification-classroom-training"},{"name":"Explore All","url":"https:\/\/www.geeksforgeeks.org\/courses\/offline-courses"}]},"NON_NCR":{"Bengaluru":[{"name":"Data Science Classroom Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/data-science-classroom-program"},{"name":"System Design Classroom Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/system-design-classroom-program"},{"name":"MERN Full Stack Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/mern-full-stack-development-classroom"},{"name":"DSA For Interview Preparation","url":"https:\/\/www.geeksforgeeks.org\/courses\/dsa-interview-preparation-classroom"},{"name":"JAVA Backend Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-java-backend-development-program"},{"name":"Data Analytics Programme","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-data-analytics-program"},{"name":"AWS Solutions Architect Certification","url":"https:\/\/www.geeksforgeeks.org\/courses\/aws-solutions-architect-certification-classroom-training"},{"name":"Explore All","url":"https:\/\/www.geeksforgeeks.org\/courses\/offline-courses"}],"Pune":[{"name":"MERN Full Stack Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/mern-full-stack-development-classroom"},{"name":"DSA For Interview Preparation","url":"https:\/\/www.geeksforgeeks.org\/courses\/dsa-interview-preparation-classroom"},{"name":"Complete Data Analytics Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-data-analytics-program"},{"name":"Explore All","url":"https:\/\/www.geeksforgeeks.org\/courses\/offline-courses"}]}}`);
    const offlineCourseTermMapper = JSON.parse(`{"ALL_TERMIDS":["2058","6263","2628","1745","1789","2601","2057","5037","2971","2023","2162","2795"],"COURSE_TERMID_MAP":{"JAVA":["2058"],"DATA_ANALYTICS":["1745","1789","2601","2057","5037","2971","2023","2162","2795"],"DSA":["6263"],"MERN":["2628"]}}`);
</script>



<!-- To set left and right bar to 300px for non indian users -->
<style type="text/css">
  @media screen and (max-width:1500px) and (min-width:1280px){
    body.single .article-page_flex .leftBar {
      flex-basis: calc(100% - 600px);
      max-width: calc(100% - 600px);
      min-width: calc(100% - 600px);
    }
    
    .sidebar_wrapper{
      max-width: 300px;
      min-width: 300px;
    }
    
    div#secondary {
      min-width: 300px;
      max-width: 300px;
    }
    
    .widget-area{
      padding: 0px;
    }
    
    .article-page_flex .rightBar{
      padding: 20px 0px 0px 0px;
    }
    
    .article--viewer_content .a-wrapper .content {
      padding: 0px 10px 55px 20px;
    }
    
    .oinLeftbar {
      height: calc(100vh - 350px) !important;
    }  
  }
  .autoLeftBar_oin_child{
    height: 100% !important;
  }
  .autoLeftBar_oin_non_sticky{
    height: unset !important;
  }
  .sideBar--wrap.newLeftbar.oinLeftbar > div[id^='GFG_AD_Leftsidebar_']:nth-of-type(1){
    padding-top: 20px;
  }
  .sideBar--wrap.newLeftbar.oinLeftbar > div[id^='GFG_AD_Leftsidebar_']{
    padding: 5px 0;
  }
</style>
  
<!-- gfg tabs compatablity bundled js -->
  <script defer src="https://assets.geeksforgeeks.org/codetabs/codetabs.js" domain="gfg"></script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KDVRCT5');</script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DWCCJLKX3X"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
//  gtag('config', 'AW-474915276');
  gtag('config', 'G-DWCCJLKX3X');
  gtag('config', 'AW-796001856');
</script>

<!-- fancybar ad code start -->
<div id="GFG_AD_Desktop_Stickyunit_1x1"></div>
<!-- fancybar ad code ends -->
<!-- <div id="GFG_AD_gfg_mobile_320x50"></div> -->
<style>
    :root {
        --com-extra-icons-mobile-image: url(https://media.geeksforgeeks.org/auth-dashboard-uploads/Com-Extra-Icons13.svg);
        --write-experience-card-1: #ECF5F5;
        --write-experience-card-icon-1: #21898C;
        --write-experience-card-2: #EAF2F7;
        --write-experience-card-icon-2: #3079AC;
        --write-experience-card-3: #FDEFE6;
        --write-experience-card-icon-3: #F5A572;
        --write-experience-card-4: #F1F8F5;
        --write-experience-card-icon-4: #91C4AD;
        --write-experience-card-5: #EEE7FF;
        --write-experience-card-icon-5: #8B72C9;
        --write-experience-card-6: #F2F8E6;
        --write-experience-card-icon-6: #78C57F;
        --editor-button-text-color: #6E6E73;
        --write-modal-background: #fefefe;
        --experience-sidebar: #000;
        --left-bar-background: #FFFFFF;
        --write-redirect-container:#EAF2F7;
        --write-redirect-container-hover:#d6e7f2;
        
    }

    /* Dark Mode */
    body[data-dark-mode="true"] {
        --write-modal-background: #161c23;
        --experience-sidebar: #000;
        --left-bar-background: #F0F3F5;
    }

    .popup-main {
        padding: 20px 18px 20px 18px;
        border-radius: 8px;
    }

    .popup-main .popup-heading {
        display: flex;
        align-items: center;
        color: #E9E9EA;
        margin-bottom: 10px;
        justify-content: space-between;
    }

    .popup-main .close-icon {
        background-image: var(--com-extra-icons-mobile-image);background-position: -15px -1651px;height: 22px;width: 22px;transform: scale(1);
        margin-bottom: 12px;
        cursor: pointer;
    }

    .popup-main .experience-card {
        color: #000;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-bottom:10px;
    }

    .popup-main a:hover,
    .popup-main a:active,
    .popup-main a:visited {
        color: inherit;
        text-decoration: none;
    }

    .popup-main .exp-card1,
    .popup-main .exp-card2,
    .popup-main .exp-card3,
    .popup-main .exp-card4,
    .popup-main .exp-card5,
    .popup-main .exp-card6 {
        display: flex;
        align-items: center;
        border-radius: 10px;
        cursor: pointer;
    }

    .popup-main .exp-card1 .icon1,
    .popup-main .exp-card2 .icon2,
    .popup-main .exp-card3 .icon3,
    .popup-main .exp-card4 .icon4,
    .popup-main .exp-card5 .icon5,
    .popup-main .exp-card6 .icon6 {
        width: 80px;
        height: 80px;
        border-radius: 10px 0px 0px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--write-experience-card-icon-1);
    }

    .popup-main .exp-card1 .icon1,
    .popup-main .exp-card2 .icon2,
    .popup-main .exp-card3 .icon3,
    .popup-main .exp-card4 .icon4,
    .popup-main .exp-card5 .icon5,
    .popup-main .exp-card6 .icon6 {
        width: 80px;
        height: 80px;
        border-radius: 10px 0px 0px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .popup-main .exp-card1 .icon1 {
        background: var(--write-experience-card-icon-1);
    }

    .popup-main .exp-card2 .icon2 {
        background: var(--write-experience-card-icon-2);
    }

    .popup-main .exp-card3 .icon3 {
        background: var(--write-experience-card-icon-3);
    }

    .popup-main .exp-card4 .icon4 {
        background: var(--write-experience-card-icon-4);
    }

    .popup-main .exp-card5 .icon5 {
        background: var(--write-experience-card-icon-5);
    }

    .popup-main .exp-card6 .icon6 {
        background: var(--write-experience-card-icon-6);
    }

    .popup-main .exp-card6 .icon6-image {
        background-image: url(https://media.geeksforgeeks.org/auth-dashboard-uploads/compass.svg);
        width: 46px;
        height: 30px;
        background-size: 30px;
        background-repeat: no-repeat;
        background-position: center;
    }

    .popup-main .exp-card1 .icon1-image {
        background-image: var(--com-extra-icons-mobile-image);
        width: 46px;
        height: 28px;
        background-position: -4px -812px;
    }

    .popup-main .exp-card2 .icon2-image {
        background-image: var(--com-extra-icons-mobile-image);
        width: 46px;
        height: 28px;
        background-position: -4px -888px;
    }

    .popup-main .exp-card3 .icon3-image {
        background-image: var(--com-extra-icons-mobile-image);
        width: 46px;
        height: 28px;
        background-position: -4px -848px;
    }

    .popup-main .exp-card4 .icon4-image {
        background-image: url(https://media.geeksforgeeks.org/auth-dashboard-uploads/competitive.svg);
        width: 46px;
        height: 30px;
        background-size: 30px;
        background-repeat: no-repeat;
        background-position: center;
    }

    .popup-main .exp-card5 .icon5-image {
        background-image: var(--com-extra-icons-mobile-image);
        width: 46px;
        height: 33px;
        background-position: -4px -1217px;
    }


    .popup-main .exp-card1 .exp-card1-text,
    .popup-main .exp-card2 .exp-card2-text,
    .popup-main .exp-card3 .exp-card3-text,
    .popup-main .exp-card4 .exp-card4-text,
    .popup-main .exp-card5 .exp-card5-text,
    .popup-main .exp-card6 .exp-card6-text {
        display: flex;
        align-items: center;
        border-radius: 0px 10px 10px 0px;
        height: 80px;
        width: calc(100% - 80px);
    }

    .popup-main .exp-card1 {
        justify-content: flex-start;
        background: var(--write-experience-card-1);
    }

    .popup-main .exp-card2 {
        justify-content: flex-start;
        background: var(--write-experience-card-2);
    }

    .popup-main .exp-card3 {
        justify-content: flex-start;
        background: var(--write-experience-card-3);
    }

    .popup-main .exp-card4 {
        justify-content: flex-start;
        background: var(--write-experience-card-4);
    }

    .popup-main .exp-card5 {
        justify-content: flex-start;
        background: var(--write-experience-card-5);
    }

    .popup-main .exp-card6 {
        justify-content: flex-start;
        background: var(--write-experience-card-6);
    }

    .popup-main span {
        font-family: var(--font-primary);
        font-size: 14px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
        padding-left: 5px;
        padding-right: 5px;
    }

    #popup {
        display: none;
        background-color: var(--write-modal-background);
        padding: 20px;
        text-align: center;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1026;
        width: min(650px, calc(100% - 20px));
    }
    .link-container-write{
        display:flex;
        flex-direction:column;
    }
    .link-container-write > a {
        margin:7px 0px;
    }
    .phrase__container{
        color:var(--color-gfg);
        border-radius: 6px;
        width: 100%;
        background-color:var(--write-redirect-container);
        padding: 15px;
        text-align: justify;
        font-size:14px;
    }
    .phrase__container:hover {
        color:var(--color-gfg) !important;
        background-color:var(--write-redirect-container-hover);
    }
</style>
<div class="popup-container">
        <div id="popup" accesskey="" class="popup-main">
            <div class="popup-heading">
                <h2>What kind of Experience do you want to share?</h2>
                <div class="close-icon share-experience-modal-close"></div>
            </div>
            <!-- <span class="description"style="color: #BEBEC2;">Tell us your type of experiences which can help other fellow Geeks for their future events and preparations.</span> -->
            <div class="experience-card">
                <a class="exp-card5" href= "https://write.geeksforgeeks.org/posts-new?cid=e8fc46fe-75e7-4a4b-be3c-0c862d655ed0" target="_blank">
                    <div class="icon5">
                        <div class="icon5-image"></div>
                    </div>
                    <div class="exp-card5-text">
                        <span style="color: #000;">Interview Experiences</span>
                    </div>
                </a>
                <a class="exp-card1" href="https://write.geeksforgeeks.org/posts-new?cid=82536bdb-84e6-4661-87c3-e77c3ac04ede" target="_blank">
                    <div class="icon1">
                        <div class="icon1-image"></div>
                    </div>
                    <div class="exp-card1-text">
                        <span style="color: #000;">Admission Experiences</span>
                    </div>
                </a>
                <a class="exp-card6" href= "https://write.geeksforgeeks.org/posts-new?cid=5219b0b2-7671-40a0-9bda-503e28a61c31" target="_blank">
                    <div class="icon6">
                        <div class="icon6-image"></div>
                    </div>
                    <div class="exp-card6-text">
                        <span style="color: #000;">Career Journeys</span>
                    </div>
                </a>
                <a class="exp-card2" href="https://write.geeksforgeeks.org/posts-new?cid=22ae3354-15b6-4dd4-a5b4-5c7a105b8a8f" target="_blank">
                    <div class="icon2">
                        <div class="icon2-image"></div>
                    </div>
                    <div class="exp-card2-text">
                        <span style="color: #000;">Work Experiences</span>
                    </div>
                </a>
                <a class="exp-card3" href= "https://write.geeksforgeeks.org/posts-new?cid=c5e1ac90-9490-440a-a5fa-6180c87ab8ae" target="_blank">
                    <div class="icon3">
                        <div class="icon3-image"></div>
                    </div>
                    <div class="exp-card3-text">
                        <span style="color: #000;">Campus Experiences</span>
                    </div>
                </a>
                <a class="exp-card4" href= "https://write.geeksforgeeks.org/posts-new?cid=5ebb8fe9-b980-4891-af07-f2d62a9735f2" target="_blank">
                    <div class="icon4">
                        <div class="icon4-image"></div>
                    </div>
                    <div class="exp-card4-text">
                        <span style="color: #000;">Competitive Exam Experiences</span>
                    </div>
                </a>
            </div>
            <div class="link-container-write">
                <a href="https://write.geeksforgeeks.org/pick-article?taxonomy=10261&page=1">
                    <div role="span" class="phrase__container">
                        Can't choose a topic to write? click here for suggested topics
                    </div>
                </a>
                <a href="https://write.geeksforgeeks.org/posts-new">
                    <div role="span" class="phrase__container">
                       Write and publish your own Article
                    </div>
                </a>
            </div>
        </div>
        <div id="overlay" onclick="toggleExperiencePopup()" style="display: block;min-height: 100vh;min-width: 100vw;position: fixed;top: 0;bottom: 0;right: 0;left: 0;display: none;justify-content: center;align-items: center;background: rgba(0,0,0,.702);z-index: 1025 !important;backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);word-break: keep-all;"></div>
    </div>

    <script>
        $('.share-experience-modal').click(function(e){
            e.preventDefault();
            var link = $(this).attr('href');
            toggleExperiencePopup(link);
        });
        function toggleExperiencePopup(link) {
            var popup = document.getElementById("popup");
            var overlay = document.getElementById("overlay");

            if (window.innerWidth < 992) {
                window.location.href = link;
            } else {
                popup.style.display = (popup.style.display === "block") ? "none" : "block";
                overlay.style.display = (overlay.style.display === "block") ? "none" : "block";
            }
        }
        $('.share-experience-modal-close').click(function(e){
            var popup = document.getElementById("popup");
            popup.style.display = 'none';
            var overlay = document.getElementById("overlay");
            overlay.style.display = 'none';
        });
</script>
</div><script type="text/javascript">
    $(window).on('load', function() {
        (function(c,l,a,r,i,t,y){
            c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
            t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
            y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
        })(window, document, "clarity", "script", "ayc7ypwwuk");
    });
</script>
</body>
</html>

<!-- Dynamic page generated in 1.659 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2024-07-29 16:16:50 -->

<!-- Compression = gzip -->
<!-- super cache -->